summaryrefslogtreecommitdiff
path: root/trunk/TAO/tao/Utils/Encodable.h
blob: 15afe05370f4082be152000b4506411aa81e50e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// -*- C++ -*-

//=============================================================================
/**
 *  @file    Encodable.h
 *
 *  $Id$
 *
 *   Defines the interface for classes that wish to be
 *   encodable/decodable into/from a CDR representation.
 *
 *  @author  Angelo Corsaro <corsaro@cs.wustl.edu>
 */
//=============================================================================

#ifndef TAO_ENCODABLE_H_
#define TAO_ENCODABLE_H_

#include /**/ "ace/pre.h"

#include "tao/Basic_Types.h"

#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */

#include "tao/Utils/utils_export.h"

TAO_BEGIN_VERSIONED_NAMESPACE_DECL

class TAO_OutputCDR;
class TAO_InputCDR;

/**
 * @class TAO_Encodable
 *
 * @brief TAO_Encodable Interface
 *
 * This interface should be inherited by classes that wish to be
 * encoded/decoded into/from a CDR stream. Implementation of the
 * streaming methods is deferred to the subclasses.
 */
class TAO_UTILS_Export TAO_Encodable
{
public:

  virtual ~TAO_Encodable (void);

  ///  Encodes the object implementing this method into a CDR stream.
  ///  Returns true on success and false on failure.
  virtual CORBA::Boolean _tao_encode (TAO_OutputCDR &out_cdr) = 0;

  ///  Decodes the object implementing this method from a CDR stream.
  ///  Returns true on success and false on failure.
  virtual CORBA::Boolean _tao_decode (TAO_InputCDR &in_cdr) = 0;
};

TAO_END_VERSIONED_NAMESPACE_DECL

#include /**/ "ace/post.h"

#endif /* TAO_ENCODABLE_H_ */