Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / tao / ETCL / TAO_ETCL_Constraint.h
blobed9fd2e5be33aa7d5b69014e534a5c108aa3a0b8
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file TAO_ETCL_Constraint.h
7 * @author Carlos O'Ryan (coryan@cs.wustl.edu)
8 * @author Jeff Parsons (parsons@cs.wustl.edu)
9 */
10 //=============================================================================
12 #ifndef TAO_ETCL_CONSTRAINT_H
13 #define TAO_ETCL_CONSTRAINT_H
15 #include "ace/ETCL/ETCL_Constraint.h"
17 #if !defined (ACE_LACKS_PRAGMA_ONCE)
18 # pragma once
19 #endif /* ACE_LACKS_PRAGMA_ONCE */
21 #include "tao/AnyTypeCode/Any_Impl.h"
23 #include "tao/ETCL/tao_etcl_export.h"
25 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
27 class ETCL_Constraint_Visitor;
29 ACE_END_VERSIONED_NAMESPACE_DECL
31 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
33 namespace CORBA
35 class Any;
36 typedef Any *Any_ptr;
39 class TAO_ETCL_Export TAO_ETCL_Literal_Constraint
40 : public ETCL_Literal_Constraint
42 public:
43 TAO_ETCL_Literal_Constraint ();
45 // = Constructors for each of the various types of literals.
47 explicit TAO_ETCL_Literal_Constraint (CORBA::ULong uinteger);
48 explicit TAO_ETCL_Literal_Constraint (CORBA::Long integer);
49 explicit TAO_ETCL_Literal_Constraint (CORBA::Boolean boolean);
50 explicit TAO_ETCL_Literal_Constraint (CORBA::Double doub);
51 explicit TAO_ETCL_Literal_Constraint (const char* str);
52 explicit TAO_ETCL_Literal_Constraint (CORBA::Any* any);
54 /// Copy constructors
55 TAO_ETCL_Literal_Constraint (const TAO_ETCL_Literal_Constraint& lit);
56 TAO_ETCL_Literal_Constraint (const ETCL_Literal_Constraint *lit);
58 /// Destructor.
59 virtual ~TAO_ETCL_Literal_Constraint();
61 /// Assignment operator.
62 void operator= (const TAO_ETCL_Literal_Constraint& co);
64 // Conversion routines.
65 operator ACE_CDR::Boolean () const;
66 operator ACE_CDR::ULong () const;
67 operator ACE_CDR::Long () const;
68 operator ACE_CDR::Double () const;
69 operator const char* () const;
70 operator TAO::Any_Impl* () const;
72 // Return the type represented by this MysteryOperand.
74 // = Arithmetic operators.
76 TAO_ETCL_Literal_Constraint
77 operator+ (const TAO_ETCL_Literal_Constraint& rhs);
79 TAO_ETCL_Literal_Constraint
80 operator- (const TAO_ETCL_Literal_Constraint& rhs);
82 TAO_ETCL_Literal_Constraint
83 operator* (const TAO_ETCL_Literal_Constraint& rhs);
85 TAO_ETCL_Literal_Constraint
86 operator/ (const TAO_ETCL_Literal_Constraint& rhs);
88 // Unary minus.
89 TAO_ETCL_Literal_Constraint
90 operator- ();
92 /// Ensure both operands are of the same simple numeric type.
93 virtual Literal_Type
94 widest_type (const ETCL_Literal_Constraint& rhs);
96 /// Determine the comparable Expression Type from the CORBA type
97 static Literal_Type
98 comparable_type (CORBA::TypeCode_ptr type);
100 private:
101 /// Private copy method.
102 void copy (const TAO_ETCL_Literal_Constraint& co);
104 /// Possible literal type not covered by the base class.
105 TAO::Any_Impl* any_;
108 TAO_END_VERSIONED_NAMESPACE_DECL
110 #if defined (__ACE_INLINE__)
111 #include "TAO_ETCL_Constraint.inl"
112 #endif /* __ACE_INLINE__ */
114 #endif /* TAO_ETCL_CONSTRAINT_H */