summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordavid <david>2004-11-17 22:50:16 +0000
committerdavid <david>2004-11-17 22:50:16 +0000
commit454d32122d4b0f467f25a4b83429cdabed4b1ac8 (patch)
treea4de0c50cdd09139827cea4665d34e579de9d544
parent94e9e0a49b4ade60f7d3f9e93cc74c4c3214c04b (diff)
downloadtog-pegasus-CQL_2_5_BRANCH.zip
tog-pegasus-CQL_2_5_BRANCH.tar.gz
tog-pegasus-CQL_2_5_BRANCH.tar.xz
TITLE: CQL Updates DESCRIPTION: CQL Updates
-rwxr-xr-xsrc/Pegasus/CQL/CQLValue.h603
-rwxr-xr-xsrc/Pegasus/CQL/CQLValueRep.cpp2
2 files changed, 359 insertions, 246 deletions
diff --git a/src/Pegasus/CQL/CQLValue.h b/src/Pegasus/CQL/CQLValue.h
index dd41eaa..a1d9502 100755
--- a/src/Pegasus/CQL/CQLValue.h
+++ b/src/Pegasus/CQL/CQLValue.h
@@ -51,269 +51,382 @@ class PEGASUS_CQL_LINKAGE CQLFactory;
class PEGASUS_CQL_LINKAGE CQLValueRep;
/** The CQLValue class encapulates a value
- that is a CQL value. The possible CQLValue
- types are the following:
-
- Sint64
- Uint64
- String
- CIMDateTime
- CIMReference
- CQLIdentifier
-
-
- This class can resolve an identifier to a primitive
- value such as Sint64, Uint64 or String, CIMDateTime,
- and CIMReference.
-
+ that is a CQL value. The possible CQLValue
+ types are the following:
+
+ Sint64
+ Uint64
+ String
+ CIMDateTime
+ CIMReference
+ CQLIdentifier
+
+
+ This class can resolve an identifier to a primitive
+ value such as Sint64, Uint64 or String, CIMDateTime,
+ and CIMReference.
+
This class overloads and performs type checking
- on the following operators:
- <, >, =, >=. <=. <>
-
- This class overloads, performs type checking and
- uint64 handling on the following operators:
- +. -. *, /
+ on the following operators:
+ <, >, =, >=. <=. <>
+
NOTE: the CQLValue class assumes a symbolic constant
- is fully qualified.
-
- */
+ is fully qualified.
+
+*/
class PEGASUS_CQL_LINKAGE CQLValue
{
- public:
- /** Initializes object as a string.
- */
+ public:
+
enum NumericType { Hex, Binary, Decimal, Real};
enum CQLValueType { Null_type, Sint64_type, Uint64_type, Real_type, String_type,
CIMDateTime_type, CIMReference_type, CQLIdentifier_type,
CIMObject_type, Boolean_type};
- CQLValue();
- ~CQLValue();
- CQLValue(const CQLValue& val);
- CQLValue(String inString, NumericType inValueType,
- Boolean inSign = true);
-
- /** Initializes object as a CQLIdentifier.
- */
- CQLValue(CQLChainedIdentifier inCQLIdent);
-
- /** Initializes object as a CIMObjectPath.
- */
- CQLValue(CIMObjectPath inObjPath);
-
- /** Initializes object as a CIMDateTime.
- */
- CQLValue(CIMDateTime inDateTime);
-
- /** Initializes object as a literal string (non-numeric).
- */
- CQLValue(String inString);
-
- CQLValue(Sint64 inSint);
- CQLValue(Uint64 inUint);
- CQLValue(Real64 inReal);
- CQLValue(CIMInstance inInstance);
- CQLValue(Boolean inBool);
- CQLValue(CIMClass inClass);
- CQLValue(CQLValueRep rhs);
- CQLValue(CIMObject inObject);
- CQLValue(CIMValue inVal);
-
- /** This method is used to ask an identifier to resolve itself to
- a number or string (primitive value).
-
- Resolves:
- - symbolic constants
- - indexing an array
- - decoding identifier
- * URI reference
- * embedded object (e.g. myclass.embeddedobject.prop1)
- and this is recursive
- - class aliasing
- */
-
- void resolve(const CIMInstance& CI,const QueryContext& inQueryCtx);
-
- CQLValue& operator=(const CQLValue& rhs);
-
- /** operator == compares two CQLValue objects for equality and
- performs type checking.
- @param x - First CQLValue to compare
- @param y - Second CQLValue to compare
- @return true if they are identical in type, attribute and value,
- false otherwise.
- */
-
- Boolean operator==(const CQLValue& x);
-
- /** operator == compares two CQLValue objects for inequality and
- performs type checking.
- @param x - First CQLValue to compare
- @param y - Second CQLValue to compare
- @return true if they are NOT identical in type, attribute and value,
- false otherwise.
- */
-
- Boolean operator!=(const CQLValue& x);
-
- /** operator <= compares two CQLValue objects to see if x is less than or
- equal to y and performs type checking.
- @param x - First CQLValue to compare
- @param y - Second CQLValue to compare
- @return true if x is less than or equal to y,
- false otherwise.
- */
-
- Boolean operator<=(const CQLValue& x);
-
- /** operator >= compares two CQLValue objects to see if x is greater than or
- equal to y and performs type checking.
- @param x - First CQLValue to compare
- @param y - Second CQLValue to compare
- @return true if x is greater than or equal to y,
+ /**
+ Contructs CQLTermRep default object.
+
+ @param - None.
+ @return - None.
+ @throw - None.
+ <I><B>Experimental Interface</B></I><BR>
+ */
+ CQLValue();
+
+ /**
+ Contructs CQLTermRep default object.
+
+ @param - None.
+ @return - None.
+ @throw - None.
+ <I><B>Experimental Interface</B></I><BR>
+ */
+ ~CQLValue()
+
+ /**
+ Contructs CQLTermRep default object.
+
+ @param - None.
+ @return - None.
+ @throw - None.
+ <I><B>Experimental Interface</B></I><BR>
+ */;
+ CQLValue(const CQLValue& val);
+
+ /**
+ Contructs CQLTermRep default object.
+
+ @param - None.
+ @return - None.
+ @throw - None.
+ <I><B>Experimental Interface</B></I><BR>
+ */
+ CQLValue(String inString, NumericType inValueType,
+ Boolean inSign = true);
+
+ /** Initializes object as a CQLIdentifier.
+ */
+ /**
+ Contructs CQLTermRep default object.
+
+ @param - None.
+ @return - None.
+ @throw - None.
+ <I><B>Experimental Interface</B></I><BR>
+ */
+ CQLValue(CQLChainedIdentifier inCQLIdent);
+
+ /** Initializes object as a CIMObjectPath.
+ */
+ /**
+ Contructs CQLTermRep default object.
+
+ @param - None.
+ @return - None.
+ @throw - None.
+ <I><B>Experimental Interface</B></I><BR>
+ */
+ CQLValue(CIMObjectPath inObjPath);
+
+ /** Initializes object as a CIMDateTime.
+ */
+ /**
+ Contructs CQLTermRep default object.
+
+ @param - None.
+ @return - None.
+ @throw - None.
+ <I><B>Experimental Interface</B></I><BR>
+ */
+ CQLValue(CIMDateTime inDateTime);
+
+ /** Initializes object as a literal string (non-numeric).
+ */
+ /**
+ Contructs CQLTermRep default object.
+
+ @param - None.
+ @return - None.
+ @throw - None.
+ <I><B>Experimental Interface</B></I><BR>
+ */
+ CQLValue(String inString);
+
+ /**
+ Contructs CQLTermRep default object.
+
+ @param - None.
+ @return - None.
+ @throw - None.
+ <I><B>Experimental Interface</B></I><BR>
+ */
+ CQLValue(Sint64 inSint);
+
+ /**
+ Contructs CQLTermRep default object.
+
+ @param - None.
+ @return - None.
+ @throw - None.
+ <I><B>Experimental Interface</B></I><BR>
+ */
+ CQLValue(Uint64 inUint);
+
+ /**
+ Contructs CQLTermRep default object.
+
+ @param - None.
+ @return - None.
+ @throw - None.
+ <I><B>Experimental Interface</B></I><BR>
+ */
+ CQLValue(Real64 inReal);
+
+ /**
+ Contructs CQLTermRep default object.
+
+ @param - None.
+ @return - None.
+ @throw - None.
+ <I><B>Experimental Interface</B></I><BR>
+ */
+ CQLValue(CIMInstance inInstance);
+
+ /**
+ Contructs CQLTermRep default object.
+
+ @param - None.
+ @return - None.
+ @throw - None.
+ <I><B>Experimental Interface</B></I><BR>
+ */
+ CQLValue(Boolean inBool);
+
+ /**
+ Contructs CQLTermRep default object.
+
+ @param - None.
+ @return - None.
+ @throw - None.
+ <I><B>Experimental Interface</B></I><BR>
+ */
+ CQLValue(CIMClass inClass);
+
+ /**
+ Contructs CQLTermRep default object.
+
+ @param - None.
+ @return - None.
+ @throw - None.
+ <I><B>Experimental Interface</B></I><BR>
+ */
+ CQLValue(CQLValueRep rhs);
+
+ /**
+ Contructs CQLTermRep default object.
+
+ @param - None.
+ @return - None.
+ @throw - None.
+ <I><B>Experimental Interface</B></I><BR>
+ */
+ CQLValue(CIMObject inObject);
+
+ /**
+ Contructs CQLTermRep default object.
+
+ @param - None.
+ @return - None.
+ @throw - None.
+ <I><B>Experimental Interface</B></I><BR>
+ */
+ CQLValue(CIMValue inVal);
+
+ /** This method is used to ask an identifier to resolve itself to
+ a number or string (primitive value).
+
+ Resolves:
+ - symbolic constants
+ - indexing an array
+ - decoding identifier
+ * URI reference
+ * embedded object (e.g. myclass.embeddedobject.prop1)
+ and this is recursive
+ - class aliasing
+ */
+ /**
+ Contructs CQLTermRep default object.
+
+ @param - None.
+ @return - None.
+ @throw - None.
+ <I><B>Experimental Interface</B></I><BR>
+ */
+ void resolve(const CIMInstance& CI,const QueryContext& inQueryCtx);
+
+ CQLValue& operator=(const CQLValue& rhs);
+
+ /** operator == compares two CQLValue objects for equality and
+ performs type checking.
+ @param x - First CQLValue to compare
+ @param y - Second CQLValue to compare
+ @return true if they are identical in type, attribute and value,
+ false otherwise.
+ */
+
+ Boolean operator==(const CQLValue& x);
+
+ /** operator == compares two CQLValue objects for inequality and
+ performs type checking.
+ @param x - First CQLValue to compare
+ @param y - Second CQLValue to compare
+ @return true if they are NOT identical in type, attribute and value,
+ false otherwise.
+ */
+
+ Boolean operator!=(const CQLValue& x);
+
+ /** operator <= compares two CQLValue objects to see if x is less than or
+ equal to y and performs type checking.
+ @param x - First CQLValue to compare
+ @param y - Second CQLValue to compare
+ @return true if x is less than or equal to y,
+ false otherwise.
+ */
+
+ Boolean operator<=(const CQLValue& x);
+
+ /** operator >= compares two CQLValue objects to see if x is greater than or
+ equal to y and performs type checking.
+ @param x - First CQLValue to compare
+ @param y - Second CQLValue to compare
+ @return true if x is greater than or equal to y,
false otherwise.
- */
-
- Boolean operator>=(const CQLValue& x);
-
- /** The overload operator (<) compares CQLValue obects and
- performs type checking.
- <pre>
- CQLValue val1 = "def";
- CQLValue val2 = "a";
- assert (val2 < val1);
- </pre>
- */
-
- Boolean operator<(const CQLValue& val1);
-
- /** The overload operator (>) compares CQLValue obects and
- performs type checking.
- <pre>
+ */
+
+ Boolean operator>=(const CQLValue& x);
+
+ /** The overload operator (<) compares CQLValue obects and
+ performs type checking.
+ <pre>
CQLValue val1 = "def";
CQLValue val2 = "a";
assert (val2 < val1);
- </pre>
- */
-
- Boolean operator>(const CQLValue& val1);
-
- /** This overload operator (+) concatenates or adds the value of
- CQLValue objects and performs type checking and Uint64 handling.
- For example,
- <pre>
- CQLValue t1 = "abc"; // it's a string type
+ </pre>
+ */
+
+ Boolean operator<(const CQLValue& val1);
+
+ /** The overload operator (>) compares CQLValue obects and
+ performs type checking.
+ <pre>
+ CQLValue val1 = "def";
+ CQLValue val2 = "a";
+ assert (val2 < val1);
+ </pre>
+ */
+
+ Boolean operator>(const CQLValue& val1);
+
+ /** This overload operator (+) concatenates or adds the value of
+ CQLValue objects and performs type checking and Uint64 handling.
+ For example,
+ <pre>
+ CQLValue t1 = "abc"; // it's a string type
CQLValue t2 = "def"; // it's another string type
CQLValue t3 = t1 + t2;
assert(t3 == "abcdef");
- </pre>
- */
-
- CQLValue operator+(const CQLValue& x);
-
- /** This overload operator (-) subtracts the value of CQLValue
- objects and performs type checking and Uint64 handling.
- For example,
- <pre>
- CQLValue t1 = 5;
- CQLValue t2 = 2;
- CQLValue t3 = t1 - t2;
- assert(t3 == 3);
- </pre>
- */
-
- //CQLValue operator-(const CQLValue& x);
-
- /** This overload operator (*) multiplies the values of CQLValue
- objects and performs type checking and Uint64 handling.
- For example,
- <pre>
- CQLValue t1 = 3;
- CQLValue t2 = 2;
- CQLValue t3 = t1 * t2;
- assert(t3 == 6);
- </pre>
- */
-
- //CQLValue operator*(const CQLValue& x);
-
- /** This overload operator (*) divides the values of CQLValue
- objects and performs type checking and Uint64 handling.
- For example,
- <pre>
- CQLValue t1 = 6;
- CQLValue t2 = 2;
- CQLValue t3 = t1 / t2;
- assert(t3 == 2);
- </pre>
- */
-
- //CQLValue operator/(const CQLValue& x);
-
- /** Accessor for getting the type of the CQLValue.
-
- TODO: do we need this method?
- */
-
- CQLValueType getValueType();
-
- /** Clears this object and sets its type to NULL_VALUE
- */
-
- void setNull();
-
- /** Returns whether the value has been resolved to a primitive.
- */
-
- Boolean isResolved();
-
- /** Returns whether the CQLValue is null.
- */
-
- Boolean isNull();
-
- /** Tests to see if this "isa" the input string.
- */
-
- Boolean isa(const CQLChainedIdentifier& cid, QueryContext& QueryCtx);
-
- /** Tests to see if this "like" the input string.
- Both sides of the LIKE comparison must have a String type:
- the result is a Boolean type.
-
- The LIKE comparison allows a string to be tested by pattern-matching,
- using special characters n the right-hand-side string.
- See the DMTF CQL Specification for details.
-
- For Basic Query, the left-hand expression (this) may be restricted to
- chain, and
- the right-hand expression may be restricted to be a literal-string.
- */
-
- Boolean like(const CQLValue& inVal);
- /*
- void invert();
- */
- CQLChainedIdentifier getChainedIdentifier()const;
- Uint64 getUint()const;
- Sint64 getSint()const;
- Real64 getReal()const;
- String getString()const;
- Boolean getBool()const;
- CIMDateTime getDateTime()const;
- CIMObjectPath getReference()const;
- CIMObject getObject()const;
- String toString()const;
- void applyContext(QueryContext& _ctx,
- CQLChainedIdentifier& inCid);
- friend class CQLFactory;
-
- private:
-
-
- CQLValueRep *_rep;
+ </pre>
+ */
+
+ CQLValue operator+(const CQLValue& x);
+
+
+
+ /** Accessor for getting the type of the CQLValue.
+
+ TODO: do we need this method?
+ */
+
+ CQLValueType getValueType();
+
+ /** Clears this object and sets its type to NULL_VALUE
+ */
+
+ void setNull();
+
+ /** Returns whether the value has been resolved to a primitive.
+ */
+
+ Boolean isResolved();
+
+ /** Returns whether the CQLValue is null.
+ */
+
+ Boolean isNull();
+
+ /** Tests to see if this "isa" the input string.
+ */
+
+ Boolean isa(const CQLChainedIdentifier& cid, QueryContext& QueryCtx);
+
+ /** Tests to see if this "like" the input string.
+ Both sides of the LIKE comparison must have a String type:
+ the result is a Boolean type.
+
+ The LIKE comparison allows a string to be tested by pattern-matching,
+ using special characters n the right-hand-side string.
+ See the DMTF CQL Specification for details.
+
+ For Basic Query, the left-hand expression (this) may be restricted to
+ chain, and
+ the right-hand expression may be restricted to be a literal-string.
+ */
+
+ Boolean like(const CQLValue& inVal);
+ /*
+ void invert();
+ */
+ CQLChainedIdentifier getChainedIdentifier()const;
+ Uint64 getUint()const;
+ Sint64 getSint()const;
+ Real64 getReal()const;
+ String getString()const;
+ Boolean getBool()const;
+ CIMDateTime getDateTime()const;
+ CIMObjectPath getReference()const;
+ CIMObject getObject()const;
+ String toString()const;
+ void applyContext(QueryContext& _ctx,
+ CQLChainedIdentifier& inCid);
+ friend class CQLFactory;
+
+ private:
+
+
+ CQLValueRep *_rep;
};
#ifndef PEGASUS_ARRAY_T
diff --git a/src/Pegasus/CQL/CQLValueRep.cpp b/src/Pegasus/CQL/CQLValueRep.cpp
index 0313afe..7013ef1 100755
--- a/src/Pegasus/CQL/CQLValueRep.cpp
+++ b/src/Pegasus/CQL/CQLValueRep.cpp
@@ -1411,7 +1411,7 @@ void CQLValueRep::_setValue(CIMValue cv,Sint64 index)
}
case CIMTYPE_REAL32:
{
- Real64 _tmp;
+ Real32 _tmp;
cv.get(_tmp);
_theValue = CIMValue((Real64)_tmp);
_valueType = CQLValue::Real_type;