summaryrefslogtreecommitdiff
path: root/TAO/TAO_IDL/be_include/be_attribute.h
blob: 7df4bcf28e4be0e8a9872c7c81482a4776993188 (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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98

//=============================================================================
/**
 *  @file    be_attribute.h
 *
 *  $Id$
 *
 *  Extension of class AST_Attribute that provides additional means for C++
 *  mapping.
 *
 *
 *  @author Copyright 1994-1995 by Sun Microsystems
 *  @author Inc. and Aniruddha Gokhale
 */
//=============================================================================


#ifndef BE_ATTRIBUTE_H
#define BE_ATTRIBUTE_H

#include "ast_attribute.h"
#include "be_decl.h"
#include "be_operation_strategy.h"

class AST_Type;
class be_visitor;

class be_attribute : public virtual AST_Attribute,
                     public virtual be_decl
{
public:
  be_attribute (void);

  be_attribute (bool ro,
                AST_Type *ft,
                UTL_ScopedName *n,
                bool local,
                bool abstract);

  // Non-virtual override of frontend method.
  be_type *field_type (void) const;

  // Visiting.
  virtual int accept (be_visitor *visitor);

  /**
   * Set the get operation strategy.
   * Note, that it is not actually used, the operation
   * made out of the attribute is going to copy it.
   */
  be_operation_strategy *set_get_strategy (
      be_operation_strategy *new_strategy
    );

  /**
   * Set the set operation strategy.
   * Note, that it is not actually used, the operation
   * made out of the attribute is going to copy it.
   */
  be_operation_strategy *set_set_strategy (
      be_operation_strategy *new_strategy
    );

  /// Retrieve the underlying get_operation strategy.
  be_operation_strategy *get_get_strategy (void);

  /// Retrieve the underlying set_operation strategy.
  be_operation_strategy *get_set_strategy (void);

  /// Cleanup.
  virtual void destroy (void);

  /// Sets the original attribute from which this one was created,
  /// applies only to implied IDL.
  void original_attribute (be_attribute *original_attribute);

  /// Returns the original attribute from which this one was created,
  /// applies only to implied IDL
  be_attribute *original_attribute ();

  // Narrowing

  DEF_NARROW_FROM_DECL (be_attribute);

private:
  be_operation_strategy *get_strategy_;

  /**
   * Member for holding the strategy for covering
   * differences between various operations, e.g. sendc_, raise_
   * operations in the AMI spec.
   */
  be_operation_strategy *set_strategy_;

  be_attribute *original_attribute_;
};

#endif