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

TStreamableObject.hh

解説を見る。
00001 // =====================================================================
00002 //  $Id: TStreamableObject.hh,v 1.2 2003/07/30 16:17:51 goiwai Exp $
00003 //  $Name: CLDAQ-1-07-00 $
00004 //
00005 //  $Log: TStreamableObject.hh,v $
00006 //  Revision 1.2  2003/07/30 16:17:51  goiwai
00007 //  ファイルにコミットログをつけることにしました.
00008 //
00009 // =====================================================================
00010 #ifndef __TSTREAMABLEOBJECT_HH
00011 #define __TSTREAMABLEOBJECT_HH
00012 
00013 #include "Tglobals.h"
00014 
00015 class TOutputObjectStream;
00016 
00017 class TStreamableObject
00018 {
00019 
00020   protected:
00021     Tobject_t theObjectType;
00022     Tstring theID;
00023 
00024   public:
00025     TStreamableObject( Tobject_t objecttype, const Tstring& id );
00026     TStreamableObject( const TStreamableObject& right );
00027 
00028   public:
00029     Tobject_t GetObjectType() const;
00030     const Tstring& GetID() const;
00031     Tvoid SetObjectType( Tobject_t objecttype );
00032     Tvoid SetID( const Tstring& id );
00033 
00034   public:
00035     virtual const TStreamableObject& operator=( const TStreamableObject& right );
00036     virtual Tbool operator==( const TStreamableObject& right ) const;
00037     virtual Tbool operator!=( const TStreamableObject& right ) const;
00038 
00039   protected:
00040     virtual ~TStreamableObject();
00041 
00042   public:
00043     virtual Tint GetRecordSize() = 0;
00044     virtual Tint Record( TOutputObjectStream* output ) = 0;
00045     virtual Tvoid Clear() = 0;
00046     virtual Tint Serialize( Tvoid* buffer ) = 0;
00047 
00048 };
00049 
00050 inline Tobject_t TStreamableObject::GetObjectType() const
00051 {
00052   return( theObjectType );
00053 }
00054 
00055 inline const Tstring& TStreamableObject::GetID() const
00056 {
00057   return( theID );
00058 }
00059 
00060 inline Tvoid TStreamableObject::SetObjectType( Tobject_t objecttype )
00061 { 
00062   theObjectType = objecttype;
00063   return;
00064 }
00065 
00066 inline Tvoid TStreamableObject::SetID( const Tstring& id )
00067 {
00068   theID = id;
00069   return;
00070 }
00071 
00072 #endif

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