00001 00022 #ifndef SUIFKERNEL__IO_SUBSYSTEM_H 00023 #define SUIFKERNEL__IO_SUBSYSTEM_H 00024 00025 #include "suifkernel_forwarders.h" 00026 #include "subsystem.h" 00027 00028 // called whenever cloning an object of type 'metaClass' is cloned 00029 typedef void (*ObjectClone)( SuifCloneStream* scs, 00030 const ObjectWrapper &obj, 00031 bool addressable ); 00032 00033 class InputSubSystem : public SubSystem { 00034 public: 00035 InputSubSystem( SuifEnv* suif_env ); 00036 00037 virtual FileSetBlock *read( const String& inputFileName ) = 0; 00038 00039 virtual ~InputSubSystem(); 00040 }; 00041 00042 00043 class OutputSubSystem : public SubSystem { 00044 public: 00045 OutputSubSystem( SuifEnv* suif_env ); 00046 00047 virtual void write( const String& outputFileName ) = 0; 00048 00049 virtual ~OutputSubSystem(); 00050 }; 00051 00052 00053 class CloneSubSystem : public SubSystem { 00054 public: 00055 CloneSubSystem( SuifEnv* suif_env ); 00056 00057 virtual SuifObject* deep_clone( const SuifObject* object ); 00058 virtual SuifObject* shallow_clone( const SuifObject* object ); 00059 00060 // the target parameter makes only sense for the cloning of value classes 00061 // in all other cases it should not be used 00062 virtual Address deep_clone( Address address, const MetaClass* metaClass, Address target = 0 ); 00063 virtual Address shallow_clone( Address address, const MetaClass* metaClass, Address target = 0 ); 00064 00065 virtual CloneStream* get_deep_clone_stream() = 0; 00066 virtual CloneStream* get_shallow_clone_stream() = 0; 00067 virtual void set_deep_clone_stream(CloneStream *str) = 0; 00068 virtual void set_shallow_clone_stream(CloneStream *str) = 0; 00069 00070 virtual ~CloneSubSystem(); 00071 }; 00072 00073 #endif 00074 00075 00076