00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file TAO_ETCL_Constraint.h 00006 * 00007 * $Id: TAO_ETCL_Constraint.h 81641 2008-05-07 19:18:59Z parsons $ 00008 * 00009 * @author Carlos O'Ryan (coryan@cs.wustl.edu) 00010 * @author Jeff Parsons (parsons@cs.wustl.edu) 00011 */ 00012 //============================================================================= 00013 00014 #ifndef TAO_ETCL_CONSTRAINT_H 00015 #define TAO_ETCL_CONSTRAINT_H 00016 00017 #include "ace/ETCL/ETCL_Constraint.h" 00018 00019 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00020 # pragma once 00021 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00022 00023 #include "tao/AnyTypeCode/Any_Impl.h" 00024 00025 #include "tao/ETCL/tao_etcl_export.h" 00026 00027 ACE_BEGIN_VERSIONED_NAMESPACE_DECL 00028 00029 class ETCL_Constraint_Visitor; 00030 00031 ACE_END_VERSIONED_NAMESPACE_DECL 00032 00033 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00034 00035 namespace CORBA 00036 { 00037 class Any; 00038 typedef Any *Any_ptr; 00039 } 00040 00041 class TAO_ETCL_Export TAO_ETCL_Literal_Constraint 00042 : public ETCL_Literal_Constraint 00043 { 00044 public: 00045 TAO_ETCL_Literal_Constraint (void); 00046 00047 // = Constructors for each of the various types of literals. 00048 00049 explicit TAO_ETCL_Literal_Constraint (CORBA::ULong uinteger); 00050 explicit TAO_ETCL_Literal_Constraint (CORBA::Long integer); 00051 explicit TAO_ETCL_Literal_Constraint (CORBA::Boolean boolean); 00052 explicit TAO_ETCL_Literal_Constraint (CORBA::Double doub); 00053 explicit TAO_ETCL_Literal_Constraint (const char* str); 00054 explicit TAO_ETCL_Literal_Constraint (CORBA::Any* any); 00055 00056 /// Copy constructors 00057 TAO_ETCL_Literal_Constraint (const TAO_ETCL_Literal_Constraint& lit); 00058 TAO_ETCL_Literal_Constraint (const ETCL_Literal_Constraint *lit); 00059 00060 /// Destructor. 00061 virtual ~TAO_ETCL_Literal_Constraint(void); 00062 00063 /// Assignment operator. 00064 void operator= (const TAO_ETCL_Literal_Constraint& co); 00065 00066 // Conversion routines. 00067 operator ACE_CDR::Boolean (void) const; 00068 operator ACE_CDR::ULong (void) const; 00069 operator ACE_CDR::Long (void) const; 00070 operator ACE_CDR::Double (void) const; 00071 operator const char* (void) const; 00072 operator TAO::Any_Impl* (void) const; 00073 00074 // Return the type represented by this MysteryOperand. 00075 00076 // = Arithmetic operators. 00077 00078 TAO_ETCL_Literal_Constraint 00079 operator+ (const TAO_ETCL_Literal_Constraint& rhs); 00080 00081 TAO_ETCL_Literal_Constraint 00082 operator- (const TAO_ETCL_Literal_Constraint& rhs); 00083 00084 TAO_ETCL_Literal_Constraint 00085 operator* (const TAO_ETCL_Literal_Constraint& rhs); 00086 00087 TAO_ETCL_Literal_Constraint 00088 operator/ (const TAO_ETCL_Literal_Constraint& rhs); 00089 00090 // Unary minus. 00091 TAO_ETCL_Literal_Constraint 00092 operator- (void); 00093 00094 /// Ensure both operands are of the same simple numeric type. 00095 virtual Literal_Type 00096 widest_type (const ETCL_Literal_Constraint& rhs); 00097 00098 /// Determine the comparable Expression Type from the CORBA type 00099 static Literal_Type 00100 comparable_type (CORBA::TypeCode_ptr type); 00101 00102 private: 00103 /// Private copy method. 00104 void copy (const TAO_ETCL_Literal_Constraint& co); 00105 00106 /// Possible literal type not covered by the base class. 00107 TAO::Any_Impl* any_; 00108 }; 00109 00110 TAO_END_VERSIONED_NAMESPACE_DECL 00111 00112 #if defined (__ACE_INLINE__) 00113 #include "TAO_ETCL_Constraint.inl" 00114 #endif /* __ACE_INLINE__ */ 00115 00116 #endif /* TAO_ETCL_CONSTRAINT_H */