bool CoreModule::HandleSysCommand( istream& is ) { SysCommand s; if( s.ReadBinary( is ) ) { if( s == SysCommand::EndOfState ) { InitializeCoreConnections(); } else if( s == SysCommand::EndOfParameter ) { mReceivingNextModuleInfo = false; mFiltersInitialized = false; } else if( s == SysCommand::Start ) { /* do nothing */ } else if( s == SysCommand::Reset ) { Terminate(); } else { bcierr << "Unexpected SysCommand" << endl; } } return is ? true : false; }
bool CoreModule::HandleSysCommand( istream& is ) { SysCommand s; if( s.ReadBinary( is ) ) { if( s == SysCommand::EndOfState ) { if( mpStatevector != NULL ) bcierr << "Unexpected SysCommand::EndOfState message" << endl; delete mpStatevector; // Initialize the state vector from the state list. mpStatevector = new StateVector( mStatelist ); ostringstream oss; mpStatevector->WriteBinary( oss ); mInitialStatevector = oss.str(); mpStatevector->CommitStateChanges(); InitializeCoreConnections(); mFiltersInitialized = false; } else if( s == SysCommand::EndOfParameter ) { // This happens for subsequent initializations. if( mpStatevector != NULL ) { mFiltersInitialized = false; } } else if( s == SysCommand::Start ) { /* do nothing */ } else if( s == SysCommand::Reset ) Terminate(); else BCIERR << "Unexpected SysCommand" << endl; } return is; }