TInputObjectStream.hh Source File

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

# TInputObjectStream.hh

解説を見る。

    00001 // =====================================================================
    00033 // =====================================================================
    00034 #ifndef __TINPUTOBJECTSTREAM_HH
    00035 #define __TINPUTOBJECTSTREAM_HH
    00036
    00037 #include "Tglobals.h"
    00038 #include "TObjectStream.hh"
    00039
    00040 class TStreamableObject;
    00041 class TInputObjectFilter;
    00042
    00043
    00063 class TInputObjectStream
    00064   : public TObjectStream
    00065 {
    00066
    00067   protected:
    00068     TInputObjectFilter* theObjectFilter;
    00069
    00070   public:
    00071     TInputObjectStream( Tstream_t streamtype = tUnknownStream );
    00072     TInputObjectStream( TInputObjectFilter* filter, Tstream_t streamtype = tUnknownStream );
    00073     virtual ~TInputObjectStream();
    00074
    00075   public:
    00076     TInputObjectFilter* GetObjectFilter() const;
    00077     Tvoid SetObjectFilter( TInputObjectFilter* filter );
    00078     Tbool HasFilter() const;
    00079
    00080   public:
    00081     virtual Tint Read( TStreamableObject& object ) = 0;
    00082     friend Tint operator>>( TInputObjectStream& left, TStreamableObject& object );
    00083     friend Tint operator>>( TInputObjectStream& left, const TStreamableObject& object );
    00084
    00085 };
    00086
    00087 inline Tint operator>>( TInputObjectStream& left, TStreamableObject& object )
    00088 {
    00089   return left.Read( object );
    00090 }
    00091
    00092 inline Tint operator>>( TInputObjectStream& left, const TStreamableObject& object )
    00093 {
    00094   return left.Read( *(TStreamableObject*)(&object) );
    00095 }
    00096
    00097 inline TInputObjectFilter* TInputObjectStream::GetObjectFilter() const
    00098 {
    00099   return theObjectFilter;
    00100 }
    00101
    00102 inline Tvoid TInputObjectStream::SetObjectFilter( TInputObjectFilter* filter )
    00103 {
    00104   theObjectFilter = filter;
    00105   return;
    00106 }
    00107
    00108 inline Tbool TInputObjectStream::HasFilter() const
    00109 {
    00110   return ( theObjectFilter != 0 ) ? Ttrue : Tfalse;
    00111 }
    00112
    00113 #endif