本文整理汇总了C++中lem::Stream::read_int方法的典型用法代码示例。如果您正苦于以下问题:C++ Stream::read_int方法的具体用法?C++ Stream::read_int怎么用?C++ Stream::read_int使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lem::Stream
的用法示例。
在下文中一共展示了Stream::read_int方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
示例2: LoadBin
void SG_calibrator::LoadBin(lem::Stream &bin)
{
freq_type = bin.read_int();
if (!bin.eof())
{
bin.read(&word, sizeof(word));
id_class = bin.read_int();
coords.LoadBin(bin);
freq = bin.read_int();
}
return;
}
示例3: 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;
}
示例4: 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;
}
示例5: LoadBin
void WordEntries_File::LoadBin(lem::Stream &bin)
{
ml_ref.LoadBin(bin);
Delete_Entries();
entry_pos.clear();
coord_ref.LoadBin(bin);
/*
LEM_CHECKIT_Z( group.empty() );
const int n_group = bin.read_int();
for( int i=0; i<n_group; ++i )
{
SG_EntryGroup *g = new SG_EntryGroup(bin);
group.insert( std::make_pair( g->GetKey(), g ) );
}
*/
lookup_table.LoadBin(bin);
/*
// #if LEM_DEBUGGING==1
lem::mout->eol();
for( int kkk=0; kkk<lookup_table.lexem_slot.size(); ++kkk )
{
WordEntries_LookUpItem xxx = lookup_table.lexem_slot[kkk];
lem::mout->printf( "x[%d]=%d,%d ", kkk, xxx.start_index, xxx.len );
}
lem::mout->eol();
// #endif
*/
ientry.LoadBin(bin);
u_entry.LoadBin(bin);
ML_entry_key_list.LoadBin(bin);
ML_entry_lex_list.LoadBin(bin);
ML_entry_pre_list.LoadBin(bin);
bin.read(&max_ml_len, sizeof(max_ml_len));
bin.read(predefined_entry, sizeof(predefined_entry));
const int n_entry = bin.read_int();
entry.resize(n_entry);
// загрузили все обязательные данные, теперь опциональная загрузка.
lem::Stream::pos_type epos_begin_pos = 0;
lem::Stream::pos_type entries_begin_pos = 0;
lem::Stream::pos_type end_pos = 0;
bin.read(&epos_begin_pos, sizeof(epos_begin_pos));
bin.read(&entries_begin_pos, sizeof(entries_begin_pos));
bin.read(&end_pos, sizeof(end_pos));
if (lazy_load)
{
// статьи пока не загружаем.
entry.Nullify();
// прочитаем только список позиций начала каждой статьи.
bin.seekp(epos_begin_pos);
entry_pos.LoadBin(bin);
lem::MCollect< std::pair<int, int> > key_to_index_tmp;
key_to_index_tmp.LoadBin(bin);
for (lem::Container::size_type i = 0; i < key_to_index_tmp.size(); ++i)
key_to_index.insert(key_to_index_tmp[i]);
lem::MCollect<Lexem> ML_tmp;
ML_tmp.LoadBin(bin);
for (lem::Container::size_type i = 0; i < ML_tmp.size(); ++i)
ML_fronts.insert(ML_tmp[i]);
ML_tmp.LoadBin(bin);
for (lem::Container::size_type i = 0; i < ML_tmp.size(); ++i)
ML_ML.insert(ML_tmp[i]);
}
else
{
bin.seekp(entries_begin_pos);
entry_pos.clear();
// список словарных статей загружаем сразу целиком в память.
for (int i0 = 0; i0 < n_entry; i0++)
{
entry[i0] = new SG_Entry;
entry[i0]->LoadBin(bin);
if (entry[i0] != bogus_entry)
entry[i0]->ReattachToRefs(*sg);
}
for (lem::Container::size_type ie = 0; ie < entry.size(); ie++)
{
key_to_index.insert(std::make_pair(entry[ientry[ie]]->GetKey(), ie));
}
//.........这里部分代码省略.........