本文整理汇总了C++中lem::Stream::read方法的典型用法代码示例。如果您正苦于以下问题:C++ Stream::read方法的具体用法?C++ Stream::read怎么用?C++ Stream::read使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lem::Stream
的用法示例。
在下文中一共展示了Stream::read方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadBin
void PatternDefaultLinkage::LoadBin( lem::Stream &bin )
{
optional_node = bin.read_bool();
bin.read( &marker_name, sizeof(marker_name) );
bin.read( &node_name, sizeof(node_name) );
return;
}
示例2: switch
void Lemmatizator::LoadString1( lem::CString *str, lem::Stream &bin, int compression )
{
switch( char_size )
{
case 1:
{
if( compression==0 )
{
bin.read( str->ptr(), lem::CString::max_len );
str->ptr()[lem::CString::max_len]=0;
}
else
{
lem::uint8_t len = bin.read_uint8();
bin.read( str->ptr(), len );
str->ptr()[len]=0;
}
str->calc_hash();
break;
}
default:
{
LEM_STOPIT;
}
}
}
示例3: LoadBin
void PatternConstraint::LoadBin( lem::Stream &bin )
{
bin.read( &from_marker, sizeof(from_marker) );
bin.read( &to_marker, sizeof(to_marker) );
from_coord_id = bin.read_int();
to_coord_id = bin.read_int();
bin.read( &constraint_func, sizeof(constraint_func) );
return;
}
示例4: LoadBin
void PatternLink::LoadBin( lem::Stream &bin )
{
bin.read( &from_marker, sizeof(from_marker) );
bin.read( &from_node, sizeof(from_node) );
bin.read( &to_marker, sizeof(to_marker) );
bin.read( &to_node, sizeof(to_node) );
bin.read( &link_type, sizeof(link_type) );
optional_to_node = bin.read_bool();
return;
}
示例5: u
void ModelCodeBook::LoadUtf8( lem::Stream & bin, lem::UCString & str )
{
lem::uint32_t utf8_len=0;
bin.read( &utf8_len, sizeof(utf8_len) );
lem::uint8_t buffer[ lem::UCString::max_len*6+1 ];
bin.read( buffer, utf8_len );
buffer[utf8_len] = 0;
lem::FString u( (const char*)buffer );
str = lem::UCString(lem::from_utf8(u).c_str());
return;
}
示例6: LoadBin
void LA_WordProjBuffer::LoadBin( lem::Stream &bin )
{
buffer.LoadBin(bin);
list.LoadBin(bin);
bin.read( &nmaxproj, sizeof(nmaxproj) );
bin.read( &n_calls, sizeof(n_calls) );
bin.read( &n_succ, sizeof(n_succ) );
bin.read( &n_succ_prim, sizeof(n_succ_prim) );
bin.read( &NTOT, sizeof(NTOT) );
bin.read( &use_compiled, sizeof(use_compiled) );
bin.read( &update_list, sizeof(update_list) );
return;
}
示例7: LoadEncodedString
void Lemmatizator::LoadEncodedString( UCString *str, lem::Stream &bin, int compression )
{
switch( char_size )
{
case 1:
{
lem::uint8_t str8[ lem::CString::max_len+1 ];
if( compression==0 )
{
bin.read( str8, lem::CString::max_len );
str8[lem::CString::max_len]=0;
int i=0;
while( str8[i]!=0 )
{
str->ptr()[i] = i2wchar[str8[i]];
++i;
}
str->ptr()[i]=0;
}
else
{
lem::uint8_t len = bin.read_uint8();
bin.read( str8, len );
str8[len]=0;
for( int i=0; i<len; ++i )
{
str->ptr()[i] = i2wchar[str8[i]];
}
str->ptr()[len]=0;
}
str->calc_hash();
break;
}
default:
{
LEM_STOPIT;
}
}
}
示例8: LoadBin
void TreeDimension::LoadBin( lem::Stream &bin )
{
bin.read( &name, sizeof(name) );
const int n = bin.read_int();
for( int i=0; i<n; ++i )
nodes.push_back( new Tree_Node(bin) );
return;
}
示例9: LoadBin
void TrFun_Lambda::LoadBin( lem::Stream& bin )
{
TrFunCall::LoadBin(bin);
ret_type.LoadBin(bin);
bin.read( &name, sizeof(name) );
arg_name.LoadBin(bin);
locals.LoadBin(bin);
return;
}
示例10: LoadBin
void TrFun_CreateWordform::LoadBin( lem::Stream& bin )
{
TrFunCall::LoadBin(bin);
ientry.LoadBin(bin);
coords.LoadBin(bin);
states.LoadBin(bin);
bin.read( &form_name, sizeof(form_name) );
return;
}
示例11: Load_Packed
void UCStringSet::Load_Packed( lem::Stream &bin )
{
uint8_t N = 0;
bin.read( &N, 1 );
resize( N );
for( int i=0; i<N; i++ )
lem::Load_Packed( &(operator[](i)), bin );
return;
}
示例12: LoadBin
/*****************************************************
Загружает содержимое из указанного бинарного потока.
******************************************************/
void Word_Form::LoadBin( lem::Stream &bin )
{
bool p=bin.read_bool();
if( p )
{
Lexem *m = new Lexem;
m->LoadBin(bin);
name = RC_Lexem(m);
}
p=bin.read_bool();
if( p )
{
Lexem *m2 = new Lexem;
m2->LoadBin(bin);
normalized = RC_Lexem(m2);
}
// lexem_owner.LoadBin(bin);
// e_list.LoadBin(bin);
pair.LoadBin(bin);
// bin.read( &tfield, sizeof(tfield) );
bin.read( &entry_key, sizeof(entry_key) );
bin.read( &val, sizeof(val) );
bin.read( &score, sizeof(score) );
// bin.read( &icenter, sizeof(icenter) );
bin.read( &origin_pos, sizeof(origin_pos) );
const int n = bin.read_int();
alt.reserve(n);
for( int i=0; i<n; ++i )
{
alt.push_back( new Word_Form );
alt.back()->LoadBin(bin);
}
return;
}
示例13: LoadBin
void ModelCodeBook::LoadBin( lem::Stream & bin )
{
lem::uint32_t flags=0;
bin.read( &flags, sizeof(flags) );
bin.read( &suffix_len, sizeof(suffix_len) );
bin.read( &context_size, sizeof(context_size) );
lem::int32_t undiv_count=-1;
bin.read( &undiv_count, sizeof(undiv_count) );
for( int i=0; i<undiv_count; ++i )
{
lem::UCString w;
LoadUtf8( bin, w );
undividable_words.insert( w );
}
lem::uint32_t ntags;
bin.read( &ntags, sizeof(ntags) );
for( int i=0; i<ntags; ++i )
{
ModelTagMatcher * tag = new ModelTagMatcher();
tag->LoadBin(bin);
matchers.push_back(tag);
id2matcher.insert( std::make_pair( tag->GetId(), tag) );
}
lem::int32_t n_suffix;
bin.read( &n_suffix, sizeof(n_suffix) );
for( int i=0; i<n_suffix; ++i )
{
lem::UCString sfx;
LoadUtf8( bin, sfx );
lem::int32_t id;
bin.read( &id, sizeof(id) );
suffices.insert( std::make_pair( sfx, id ) );
}
bin.read( &START_id, sizeof(START_id) );
bin.read( &END_id, sizeof(END_id) );
return;
}
示例14: LoadBin
void Tree_Node::LoadBin(lem::Stream &bin)
{
bin.read(&ilink, sizeof(ilink));
Word_Form *wf = new Word_Form;
wf->LoadBin(bin);
node = boost::shared_ptr<Word_Form>(wf);
child.LoadBin(bin);
dims.LoadBin(bin);
return;
}
示例15: LoadBin
void TrFunction::LoadBin( lem::Stream& bin )
{
bin.read( &name, sizeof(name) );
ret_type.LoadBin(bin);
arg_name.LoadBin(bin);
arg_type.LoadBin(bin);
if( bin.read_bool() )
body = TrFunCall::load_bin(bin);
return;
}