summaryrefslogtreecommitdiff
path: root/TAO/tao/Union.h
blob: 11217900c69f04e082e82d25bb5527dff52a74ea (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
/* -*- C++ -*- */
// $Id$

// ============================================================================
//
// = LIBRARY
//    TAO
//
// = FILENAME
//    Union.h
//
// = AUTHOR
//
//    Aniruddha Gokhale (Idea by Carlos O'Ryan)
//
// ============================================================================

#ifndef TAO_UNION_H
#  define TAO_UNION_H

class TAO_Export TAO_Base_Union
{
  // = TITLE
  //   Base class for TAO Unions.
  //
  // = DESCRIPTION
  //   This class provides a common interface for all IDL unions,
  //   hence the interpreted marshal engine can manipulate them in a
  //   type-safe manner.
public:
  friend class TAO_Marshal_Union;
  // We give access to TAO_Marshal_Union, this allows a safe
  // implementation of the marshal engine.

  virtual ~TAO_Base_Union (void);
  // destructor.

  virtual void *_discriminant (void) = 0;
  // Return pointer to the discriminant.

  virtual void *_access (CORBA::Boolean flag) = 0;
  // Provides access to the right data member at the right offset. If
  // the flag is TRUE, we allocate the necessary storage. This will be
  // required for the decoding side.

  virtual void _reset (void) = 0;
  // Free existing storage.

protected:
  TAO_Base_Union (void);
  // Default constructor.

};

#endif /* TAO_BASE_UNION_H */