メインページ   モジュール   クラス階層   アルファベット順一覧   構成   ファイル一覧   構成メンバ   ファイルメンバ   関連ページ  

TStreamableObject.hh

解説を見る。
00001 // =====================================================================
00002 //  $Id: TStreamableObject.hh,v 1.1.1.1 2003/06/27 02:56:41 goiwai Exp $
00003 //  $Name: CLDAQ-1-06-00 $
00004 // =====================================================================
00005 #ifndef __TSTREAMABLEOBJECT_HH
00006 #define __TSTREAMABLEOBJECT_HH
00007 
00008 #include "Tglobals.h"
00009 
00010 class TOutputObjectStream;
00011 
00012 class TStreamableObject
00013 {
00014 
00015   protected:
00016     Tobject_t theObjectType;
00017     Tstring theID;
00018 
00019   public:
00020     TStreamableObject( Tobject_t objecttype, const Tstring& id );
00021     TStreamableObject( const TStreamableObject& right );
00022 
00023   public:
00024     Tobject_t GetObjectType() const;
00025     const Tstring& GetID() const;
00026     Tvoid SetObjectType( Tobject_t objecttype );
00027     Tvoid SetID( const Tstring& id );
00028 
00029   public:
00030     virtual const TStreamableObject& operator=( const TStreamableObject& right );
00031     virtual Tbool operator==( const TStreamableObject& right ) const;
00032     virtual Tbool operator!=( const TStreamableObject& right ) const;
00033 
00034   protected:
00035     virtual ~TStreamableObject();
00036 
00037   public:
00038     virtual Tint GetRecordSize() = 0;
00039     virtual Tint Record( TOutputObjectStream* output ) = 0;
00040     virtual Tvoid Clear() = 0;
00041     virtual Tint Serialize( Tvoid* buffer ) = 0;
00042 
00043 };
00044 
00045 inline Tobject_t TStreamableObject::GetObjectType() const
00046 {
00047   return( theObjectType );
00048 }
00049 
00050 inline const Tstring& TStreamableObject::GetID() const
00051 {
00052   return( theID );
00053 }
00054 
00055 inline Tvoid TStreamableObject::SetObjectType( Tobject_t objecttype )
00056 { 
00057   theObjectType = objecttype;
00058   return;
00059 }
00060 
00061 inline Tvoid TStreamableObject::SetID( const Tstring& id )
00062 {
00063   theID = id;
00064   return;
00065 }
00066 
00067 #endif

CLDAQ - a Class Library for Data AcQuisition (Version 1.6.0)
Go IWAI <goiwai@users.sourceforge.jp>