00001 #ifndef ISPN_HOTROD_MARSHALLER_H 00002 #define ISPN_HOTROD_MARSHALLER_H 00003 00004 #include "portable.h" 00005 #include "infinispan/hotrod/ScopedBuffer.h" 00006 00007 namespace infinispan { 00008 namespace hotrod { 00009 00010 class ScopedBuffer; 00011 00012 // Todo: application buffer memory management; async readers/writers. SSL implications? 00013 00014 template <class T> class Marshaller: public portable::counted_object 00015 { 00016 public: 00017 virtual void marshall(const T&, ScopedBuffer&) = 0; 00018 virtual T* unmarshall(const ScopedBuffer&) = 0; 00019 00020 virtual ~Marshaller() {} 00021 static void destroy(Marshaller<T> *marshaller) { delete marshaller; } 00022 }; 00023 00024 }} // namespace 00025 00026 #endif /* ISPN_HOTROD_MARSHALLER_H */