TOutputObjectStream.hh Source File

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

# TOutputObjectStream.hh

解説を見る。

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