本文整理汇总了C++中PyRep::Dump方法的典型用法代码示例。如果您正苦于以下问题:C++ PyRep::Dump方法的具体用法?C++ PyRep::Dump怎么用?C++ PyRep::Dump使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyRep
的用法示例。
在下文中一共展示了PyRep::Dump方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UnmarshalLogText
void UnmarshalLogText( const Seperator& cmd )
{
const char* cmdName = cmd.arg( 0 ).c_str();
if( 1 == cmd.argCount() )
{
sLog.Error( cmdName, "Usage: %s marshal-binary [marshal-binary] ...", cmdName );
return;
}
for( size_t i = 1; i < cmd.argCount(); ++i )
{
const std::string& marshalBinaryStr = cmd.arg( i );
Buffer marshalBinary;
if( !PyDecodeEscape( marshalBinaryStr.c_str(), marshalBinary ) )
{
sLog.Error( cmdName, "Failed to decode string into binary." );
continue;
}
PyRep* r = InflateUnmarshal( marshalBinary );
if( NULL == r )
sLog.Error( cmdName, "Failed to unmarshal binary." );
else
{
sLog.Success( cmdName, "Result:" );
r->Dump( stdout, " " );
PyDecRef( r );
}
}
}
示例2: PopPacket
PyPacket* EVEClientSession::PopPacket()
{
PyRep* r = mNet->PopRep();
if( r == NULL )
return NULL;
if(is_log_enabled(NET__PRES_REP)) {
_log(NET__PRES_REP, "%s: Raw Rep Dump:", GetAddress().c_str());
r->Dump(NET__PRES_REP, " ");
}
assert( mPacketHandler );
return ( this->*mPacketHandler )( r );
}
示例3: TestMarshal
void TestMarshal( const Seperator& cmd )
{
const char* cmdName = cmd.arg( 0 ).c_str();
DBRowDescriptor *header = new DBRowDescriptor;
// Fill header:
header->AddColumn( "historyDate", DBTYPE_FILETIME );
header->AddColumn( "lowPrice", DBTYPE_CY );
header->AddColumn( "highPrice", DBTYPE_CY );
header->AddColumn( "avgPrice", DBTYPE_CY );
header->AddColumn( "volume", DBTYPE_I8 );
header->AddColumn( "orders", DBTYPE_I4 );
CRowSet* rs = new CRowSet( &header );
PyPackedRow* row = rs->NewRow();
row->SetField( "historyDate", new PyLong( Win32TimeNow() ) );
row->SetField( "lowPrice", new PyLong( 18000 ) );
row->SetField( "highPrice", new PyLong( 19000 ) );
row->SetField( "avgPrice", new PyLong( 18400 ) );
row->SetField( "volume", new PyLong( 5463586 ) );
row->SetField( "orders", new PyInt( 254 ) );
sLog.Log( cmdName, "Marshaling..." );
Buffer marshaled;
bool res = MarshalDeflate( rs, marshaled );
PyDecRef( rs );
if( !res )
{
sLog.Error( cmdName, "Failed to marshal Python object." );
return;
}
sLog.Log( cmdName, "Unmarshaling..." );
PyRep* rep = InflateUnmarshal( marshaled );
if( NULL == rep )
{
sLog.Error( cmdName, "Failed to unmarshal Python object." );
return;
}
sLog.Success( cmdName, "Final:" );
rep->Dump( stdout, " " );
PyDecRef( rep );
}