00001 #ifndef SUIFKERNEL__SUIF_CLONE_STREAM_H 00002 #define SUIFKERNEL__SUIF_CLONE_STREAM_H 00003 00004 // A compiler bug in Motana doesn't allow compilation of this class 00005 #ifndef MONTANABUG 00006 00007 00008 #include "iokernel/clone_stream.h" 00009 00010 #include "suifkernel_forwarders.h" 00011 #include "io_subsystem.h" 00012 00013 00014 00015 00016 // called after cloning has taken place 00017 typedef void (*FinishClone)( SuifCloneStream*, 00018 const ObjectWrapper &obj ); 00019 00020 00021 struct FinishInfo; 00022 00023 struct FinishInfo { 00024 bool _being_finished; 00025 const MetaClass* _meta_class; 00026 FinishClone _finish_function; 00027 }; 00028 00029 00030 00031 class SuifCloneStream : public CloneStream { 00032 public: 00033 SuifCloneStream( ObjectFactory* of, MetaClassVisitor<ObjectClone>* object_clone_visitor ); 00034 virtual ~SuifCloneStream(); 00035 virtual void clonestream_write( const ObjectWrapper &obj, 00036 bool addressable, 00037 FinishClone finish_function = 0 ); 00038 00039 virtual void write( const ObjectWrapper &obj, 00040 bool addressable = true ); 00041 00042 00043 // the following function allow the querying of 00044 // already registered MetaClasses. 00045 // if the input MetaClass is 0 the default_clone_behavior 00046 // will be returned. 00047 virtual ObjectClone retrieve_object_clone_behavior( MetaClass* meta_class); 00048 00049 virtual void finish( Address address ); 00050 00051 private: 00052 MetaClassVisitor<ObjectClone>* _object_clone_visitor; 00053 00054 typedef suif_map<Address,FinishInfo> FinishMap; 00055 FinishMap* _finish_map; 00056 private: 00057 // no implementation for these declarations 00058 SuifCloneStream(const SuifCloneStream &); 00059 SuifCloneStream& operator=(const SuifCloneStream &); 00060 }; 00061 00062 00063 #endif 00064 00065 #endif 00066 00067