本文整理汇总了C++中lem::Stream::write_bool方法的典型用法代码示例。如果您正苦于以下问题:C++ Stream::write_bool方法的具体用法?C++ Stream::write_bool怎么用?C++ Stream::write_bool使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lem::Stream
的用法示例。
在下文中一共展示了Stream::write_bool方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SaveBin
/**************************************************
Сохраняет содержимое в указанном бинарном потоке.
***************************************************/
void Word_Form::SaveBin( lem::Stream &bin ) const
{
bool p = !!name;
bin.write_bool( p );
if( p )
name->SaveBin(bin);
p = !!normalized;
bin.write_bool(p);
if(p)
normalized->SaveBin(bin);
// lexem_owner.SaveBin(bin);
// e_list.SaveBin(bin);
pair.SaveBin(bin);
// bin.write( &tfield, sizeof(tfield) );
bin.write( &entry_key, sizeof(entry_key) );
bin.write( &val, sizeof(val) );
bin.write( &score, sizeof(score) );
// bin.write( &icenter, sizeof(icenter) );
bin.write( &origin_pos, sizeof(origin_pos) );
bin.write_int( CastSizeToInt(alt.size()) );
for( lem::Container::size_type i=0; i<alt.size(); ++i )
alt[i]->SaveBin(bin);
return;
}
示例2: SaveBin
void PatternDefaultLinkage::SaveBin( lem::Stream &bin ) const
{
bin.write_bool(optional_node);
bin.write( &marker_name, sizeof(marker_name) );
bin.write( &node_name, sizeof(node_name) );
return;
}
示例3: SaveBin
/****************************************************************************
Метод сохраняет информацию в контейнерах Автомата в бинарном потоке (файле).
Производные классы перегружают метод, но должны в новом методе вызвать наш
базовый для сохранения содежимого таблицы параметров.
*****************************************************************************/
void Automaton::SaveBin( lem::Stream &bin ) const
{
bin.write_bool( param!=NULL );
if( param!=NULL )
param->SaveBin(bin);
return;
}
示例4: SaveBin
void PatternLink::SaveBin( lem::Stream &bin ) const
{
bin.write( &from_marker, sizeof(from_marker) );
bin.write( &from_node, sizeof(from_node) );
bin.write( &to_marker, sizeof(to_marker) );
bin.write( &to_node, sizeof(to_node) );
bin.write( &link_type, sizeof(link_type) );
bin.write_bool(optional_to_node);
return;
}
示例5: SaveBin
void TrFun_If::SaveBin( lem::Stream& bin ) const
{
TrFunCall::SaveBin(bin);
cond->SaveBin(bin);
f_then->SaveBin(bin);
bin.write_bool( f_else.NotNull() );
if( f_else.NotNull() )
f_else->SaveBin(bin);
return;
}
示例6: SaveBin
void TrFunction::SaveBin( lem::Stream& bin ) const
{
bin.write( &name, sizeof(name) );
ret_type.SaveBin(bin);
arg_name.SaveBin(bin);
arg_type.SaveBin(bin);
bin.write_bool( body.NotNull() );
if( body.NotNull() )
body->SaveBin(bin);
return;
}
示例7: SaveBin
void LEMM_Compiler::SaveBin( lem::Stream & bin ) const
{
bin.write_bool(true);
const lem::uint32_t model_flags = 0x0000000E;
bin.write( &model_flags, sizeof(model_flags) );
bin.write_int( suffix_len );
bin.write_int( CastSizeToInt(suffices.size()) );
for( lem::Container::size_type i=0; i<suffices.size(); ++i )
{
bin.write( &suffices[i].first, sizeof(suffices[i].first) );
lem::Save_Packed(suffices[i].second,bin);
}
bin.write_int( CastSizeToInt(words.size()) );
for( lem::Container::size_type i=0; i<words.size(); ++i )
{
bin.write( &words[i].first, sizeof(words[i].first) );
lem::Save_Packed(words[i].second,bin);
}
bin.write_int( CastSizeToInt(ngram2.size()) );
for( lem::Container::size_type i=0; i<ngram2.size(); ++i )
bin.write( &ngram2[i], sizeof(ngram2[i]) );
bin.write_int( CastSizeToInt(ngram2_1.size()) );
for( lem::Container::size_type i=0; i<ngram2_1.size(); ++i )
bin.write( &ngram2_1[i], sizeof(ngram2_1[i]) );
bin.write_int( CastSizeToInt(ngram3.size()) );
for( lem::Container::size_type i=0; i<ngram3.size(); ++i )
bin.write( &ngram3[i], sizeof(ngram3[i]) );
bin.write_int( CastSizeToInt(ngram3_1.size()) );
for( lem::Container::size_type i=0; i<ngram3_1.size(); ++i )
bin.write( &ngram3_1[i], sizeof(ngram3_1[i]) );
bin.write_int( CastSizeToInt(ngram3_2.size()) );
for( lem::Container::size_type i=0; i<ngram3_2.size(); ++i )
bin.write( &ngram3_2[i], sizeof(ngram3_2[i]) );
bin.write_int( CastSizeToInt(ngram4.size()) );
for( lem::Container::size_type i=0; i<ngram4.size(); ++i )
bin.write( &ngram4[i], sizeof(ngram4[i]) );
return;
}