00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file Encodable.h 00006 * 00007 * $Id: Encodable.h 71473 2006-03-10 07:19:20Z jtc $ 00008 * 00009 * Defines the interface for classes that wish to be 00010 * encodable/decodable into/from a CDR representation. 00011 * 00012 * @author Angelo Corsaro <corsaro@cs.wustl.edu> 00013 */ 00014 //============================================================================= 00015 00016 #ifndef TAO_ENCODABLE_H_ 00017 #define TAO_ENCODABLE_H_ 00018 00019 #include /**/ "ace/pre.h" 00020 00021 #include "tao/Basic_Types.h" 00022 00023 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00024 # pragma once 00025 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00026 00027 #include "tao/Utils/utils_export.h" 00028 00029 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00030 00031 class TAO_OutputCDR; 00032 class TAO_InputCDR; 00033 00034 /** 00035 * @class TAO_Encodable 00036 * 00037 * @brief TAO_Encodable Interface 00038 * 00039 * This interface should be inherited by classes that wish to be 00040 * encoded/decoded into/from a CDR stream. Implementation of the 00041 * streaming methods is deferred to the subclasses. 00042 */ 00043 class TAO_UTILS_Export TAO_Encodable 00044 { 00045 public: 00046 00047 virtual ~TAO_Encodable (void); 00048 00049 /// Encodes the object implementing this method into a CDR stream. 00050 /// Returns true on success and false on failure. 00051 virtual CORBA::Boolean _tao_encode (TAO_OutputCDR &out_cdr) = 0; 00052 00053 /// Decodes the object implementing this method from a CDR stream. 00054 /// Returns true on success and false on failure. 00055 virtual CORBA::Boolean _tao_decode (TAO_InputCDR &in_cdr) = 0; 00056 }; 00057 00058 TAO_END_VERSIONED_NAMESPACE_DECL 00059 00060 #include /**/ "ace/post.h" 00061 00062 #endif /* TAO_ENCODABLE_H_ */