(file) Return to CQLValue.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / CQL

File: [Pegasus] / pegasus / src / Pegasus / CQL / CQLValue.h (download)
Revision: 1.10, Mon Jun 19 18:37:28 2006 UTC (18 years ago) by mike
Branch: MAIN
CVS Tags: TASK_BUG_5314_IPC_REFACTORING_ROOT, TASK_BUG_5314_IPC_REFACTORING_BRANCH, TASK_BUG_5314_IPC_REFACTORING-V1, TASK_BUG_5191_QUEUE_CONSOLIDATION_ROOT, TASK_BUG_5191_QUEUE_CONSOLIDATION_BRANCH, TASK-TASK-BUG4011_WinLocalConnect-branch-New-root, TASK-TASK-BUG4011_WinLocalConnect-branch-New-merged_out_to_branch, TASK-TASK-BUG4011_WinLocalConnect-branch-New-merged_out_from_trunk, TASK-TASK-BUG4011_WinLocalConnect-branch-New-merged_in_to_trunk, TASK-TASK-BUG4011_WinLocalConnect-branch-New-merged_in_from_branch, TASK-TASK-BUG4011_WinLocalConnect-branch-New-branch, TASK-PEP268_SSLClientCertificatePropagation-root, TASK-PEP268_SSLClientCertificatePropagation-merged_out_to_branch, TASK-PEP268_SSLClientCertificatePropagation-merged_out_from_trunk, TASK-PEP268_SSLClientCertificatePropagation-merged_in_to_trunk, TASK-PEP268_SSLClientCertificatePropagation-merged_in_from_branch, TASK-PEP268_SSLClientCertificatePropagation-branch, TASK-PEP267_SLPReregistrationSupport-root, TASK-PEP267_SLPReregistrationSupport-merging_out_to_branch, TASK-PEP267_SLPReregistrationSupport-merging_out_from_trunk, TASK-PEP267_SLPReregistrationSupport-merged_out_to_branch, TASK-PEP267_SLPReregistrationSupport-merged_out_from_trunk, TASK-PEP267_SLPReregistrationSupport-merged_in_to_trunk, TASK-PEP267_SLPReregistrationSupport-merged_in_from_branch, TASK-PEP267_SLPReregistrationSupport-branch, TASK-Bugs5690_3913_RemoteCMPI-root, TASK-Bugs5690_3913_RemoteCMPI-merged_out_to_branch, TASK-Bugs5690_3913_RemoteCMPI-merged_out_from_trunk, TASK-Bugs5690_3913_RemoteCMPI-merged_in_to_trunk, TASK-Bugs5690_3913_RemoteCMPI-merged_in_from_branch, TASK-Bugs5690_3913_RemoteCMPI-branch, TASK-Bug2102_RCMPIWindows-root, TASK-Bug2102_RCMPIWindows-merged_out_to_branch, TASK-Bug2102_RCMPIWindows-merged_out_from_trunk, TASK-Bug2102_RCMPIWindows-merged_in_to_trunk, TASK-Bug2102_RCMPIWindows-merged_in_from_branch, TASK-Bug2102_RCMPIWindows-branch, TASK-Bug2021_RemoteCMPIonWindows-root, TASK-Bug2021_RemoteCMPIonWindows-merged_out_to_branch, TASK-Bug2021_RemoteCMPIonWindows-merged_out_from_trunk, TASK-Bug2021_RemoteCMPIonWindows-merged_in_to_trunk, TASK-Bug2021_RemoteCMPIonWindows-merged_in_from_branch, TASK-Bug2021_RemoteCMPIonWindows-branch, TASK-Bug2021_RCMPIonWindows-root, TASK-Bug2021_RCMPIonWindows-merged_out_to_branch, TASK-Bug2021_RCMPIonWindows-merged_out_from_trunk, TASK-Bug2021_RCMPIonWindows-merged_in_to_trunk, TASK-Bug2021_RCMPIonWindows-merged_in_from_branch, TASK-Bug2021_RCMPIonWindows-branch, TASK-BUG7240-root, TASK-BUG7240-branch, TASK-BUG4011_WinLocalConnect-branch-New, RELEASE_2_6_3-RC2, RELEASE_2_6_3-RC1, RELEASE_2_6_3, RELEASE_2_6_2-RC1, RELEASE_2_6_2, RELEASE_2_6_1-RC1, RELEASE_2_6_1, RELEASE_2_6_0-RC1, RELEASE_2_6_0-FC, RELEASE_2_6_0, RELEASE_2_6-root, RELEASE_2_6-branch-clean, RELEASE_2_6-branch, PEP286_PRIVILEGE_SEPARATION_ROOT, PEP286_PRIVILEGE_SEPARATION_CODE_FREEZE, PEP286_PRIVILEGE_SEPARATION_BRANCH, PEP286_PRIVILEGE_SEPARATION_1
Changes since 1.9: +2 -2 lines
BUG#: 5126
TITLE: Hidden default visibility for shared-library symbols (GCC 4.0 only)

DESCRIPTION: This patch introduces symbol exportation for GCC (similar to that used in Windows that requires the PEGASUS_???_LINKAGE macro).

//%2006////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
// IBM Corp.; EMC Corporation, The Open Group.
// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
// EMC Corporation; VERITAS Software Corporation; The Open Group.
// Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
// EMC Corporation; Symantec Corporation; The Open Group.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// 
// THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
// ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
// "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
//==============================================================================
//
// Author: Dave Rosckes (rosckes@us.ibm.com)
//
// Modified By: David Dillard, VERITAS Software Corp.
//                  (david.dillard@veritas.com)
//              Vijay Eli, IBM (vijayeli@in.ibm.com) bug#3590
//
//%/////////////////////////////////////////////////////////////////////////////

#ifndef PEGASUS_CQLVALUE_H
#define PEGASUS_CQLVALUE_H

#ifdef PEGASUS_USE_EXPERIMENTAL_INTERFACES

#include <Pegasus/CQL/Linkage.h>
#include <Pegasus/Common/CIMInstance.h>
#include <Pegasus/Common/ArrayInternal.h>
#include <Pegasus/Common/String.h>
#include <Pegasus/Query/QueryCommon/QueryContext.h>
#include <Pegasus/Common/CIMObjectPath.h>
#include <Pegasus/CQL/CQLChainedIdentifier.h>

PEGASUS_NAMESPACE_BEGIN
class CQLFactory;
class 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.

    This class overloads and performs type checking
    on the following operators:
    <, >, =, >=. <=. <>


    NOTE:  the CQLValue class assumes a symbolic constant
    is fully qualified.

*/

class PEGASUS_CQL_LINKAGE CQLValue
{
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};

  /**
      Contructs CQLValue default object.

      @param  None.
      @return None.
      @throw  None.
      <I><B>Experimental Interface</B></I><BR>
  */
  CQLValue();

  /**
      Destroys CQLValue object.

      @param  None.
      @return None.
      @throw  None.
      <I><B>Experimental Interface</B></I><BR>
  */
  ~CQLValue()

  /**
      Contructs CQLValue object (Copy-Constructor).

      @param  None.
      @return None.
      @throw  None.
      <I><B>Experimental Interface</B></I><BR>
  */;
  CQLValue(const CQLValue& val);

  /**
      Contructs CQLValue object given a string and a numbericType

      @param  inString The string representation of a number
      @param  inValueType The NumericType
      @return None.
      @throw  None.
      <I><B>Experimental Interface</B></I><BR>
  */
  CQLValue(const String& inString, NumericType inValueType,
       Boolean inSign = true);

  /**
      Contructs CQLValue object via CQLChainedIdentifier.

      @param  inCQLIdent The CQLChained Identifer used to create the object
      @return None.
      @throw  None.
      <I><B>Experimental Interface</B></I><BR>
  */
  CQLValue(const CQLChainedIdentifier& inCQLIdent);

  /**
      Initializes object as a CIMObjectPath.

      @param  inObjPath CIMObjectPath used to construct object.
      @return None.
      @throw  None.
      <I><B>Experimental Interface</B></I><BR>
  */
  CQLValue(const CIMObjectPath& inObjPath);

  /**
      Initializes object as a CIMDateTime.

      @param  inDateTime Datetime used to construct object.
      @return None.
      @throw  None.
      <I><B>Experimental Interface</B></I><BR>
  */
  CQLValue(const CIMDateTime& inDateTime);

  /**
      Initializes object as a literal string (non-numeric).

      @param  inString String used to construct object.
      @return None.
      @throw  None.
      <I><B>Experimental Interface</B></I><BR>
  */
  CQLValue(const String& inString);

  /**
      Initializes object as an Sint64.

      @param  inSint Sint64 used to contruct object.
      @return None.
      @throw  None.
      <I><B>Experimental Interface</B></I><BR>
  */
  CQLValue(Sint64 inSint);

  /**
      Initializes object as a Uint64

      @param  inUint Uint64 used to construct object.
      @return None.
      @throw  None.
      <I><B>Experimental Interface</B></I><BR>
  */
  CQLValue(Uint64 inUint);

  /**
      Initializes object as a Real64

      @param  inReal Real64 used to construct object.
      @return None.
      @throw  None.
      <I><B>Experimental Interface</B></I><BR>
  */
  CQLValue(Real64 inReal);

  /**
      Initializes object as a CIMInstance

      @param  inInstance CIMInstance used to construct object.
      @return None.
      @throw  None.
      <I><B>Experimental Interface</B></I><BR>
  */
  CQLValue(const CIMInstance& inInstance);

  /**
      Initializes object as a Boolean

      @param  inBool inBool used to construct object.
      @return None.
      @throw  None.
      <I><B>Experimental Interface</B></I><BR>
  */
  CQLValue(Boolean inBool);

  /**
      Initializes object as a inClass

      @param  inClass CIMClass used to construct object.
      @return None.
      @throw  None.
      <I><B>Experimental Interface</B></I><BR>
  */
  CQLValue(const CIMClass& inClass);

  /**
      Initializes object as a CQLValueRep

      @param  rhs CQLValueRep used to construct object.
      @return None.
      @throw  None.
      <I><B>Experimental Interface</B></I><BR>
  */
  CQLValue(const CQLValueRep& rhs);

  /**
      Initializes object as a CIMObject

      @param  inObject CIMObject used to construct object.
      @return None.
      @throw  None.
      <I><B>Experimental Interface</B></I><BR>
  */
  CQLValue(const CIMObject& inObject);

  /**
      Initializes object as a CIMValue

      @param  inVal CIMValue used to construct object.
      @return None.
      @throw  None.
      <I><B>Experimental Interface</B></I><BR>
  */
  CQLValue(const CIMValue& inVal);

  /**  This method is used to ask an identifier to resolve itself to
       a primitive value.

       Resolves:
       - symbolic constants
       - indexing an array
       - decoding identifier
       * embedded object (e.g. myclass.embeddedobject.prop1)
       and this is recursive
       - class aliasing

      @param  CI CIMInstance where information is retrieved.
      @param  inQueryCtx QueryContext contains query data.
      @return None.
      @throw  CQLRuntimeException.
      <I><B>Experimental Interface</B></I><BR>
  */
  void resolve(const CIMInstance& CI,const  QueryContext& inQueryCtx);

  /**
      Assignment operator.

      @param  rhs right hand side of operator.
      @return Reference to this object.
      @throw  None.
      <I><B>Experimental Interface</B></I><BR>
  */
  CQLValue& operator=(const CQLValue& rhs);

  /**
      operator == compares two CQLValue objects for equality and
      performs type checking.

      @param  rhs right hand side of operator.
      @return Boolean.
      @throw  None.
      <I><B>Experimental Interface</B></I><BR>
  */
  Boolean operator==(const CQLValue& x) const;

  /**
      operator != compares two CQLValue objects for inequality and
      performs type checking.

      @param  x Right hand side of operator.
      @return Boolean.
      @throw  None.
      <I><B>Experimental Interface</B></I><BR>
  */
  Boolean operator!=(const CQLValue& x) const;

  /**
      operator <= compares two CQLValue objects to see if leftside is less than or
      equal to right side and performs type checking.

      @param  x Right hand side of operator.
      @return Boolean.
      @throw  None.
      <I><B>Experimental Interface</B></I><BR>
  */
  Boolean operator<=(const CQLValue& x) const;

  /**
      operator >= compares two CQLValue objects to see if leftside is greater than or
      equal to rightside and performs type checking.

      @param  x Right hand side of operator.
      @return Boolean.
      @throw  None.
      <I><B>Experimental Interface</B></I><BR>
  */
  Boolean operator>=(const CQLValue& x) const;

  /**
      The overload operator < compares CQLValue obects and
      performs type checking.

      @param  val1 Right hand side of operator.
      @return Boolean.
      @throw  None.
      <I><B>Experimental Interface</B></I><BR>
  */
  Boolean operator<(const CQLValue& val1) const;

  /**
      The overload operator > compares CQLValue obects and
      performs type checking.

      @param  val1 Right hand side of operator.
      @return Boolean.
      @throw  None.
      <I><B>Experimental Interface</B></I><BR>
  */
  Boolean operator>(const CQLValue& val1) const;

  /** This overload operator (+) concatenates the value of
      CQLValue objects and performs type checking.
      (Currently supports only CQLValue of String type.)

      @param  x Right hand side of operator.
      @return Boolean.
      @throw  None.
      <I><B>Experimental Interface</B></I><BR>
  */
  CQLValue operator+(const CQLValue& x);

  /**
      Accessor for getting the type of the CQLValue.

      @param  None.
      @return CQLValueType.
      @throw  None.
      <I><B>Experimental Interface</B></I><BR>
  */
  CQLValueType getValueType() const;

  /**
      Clears this object and sets its type to NULL_VALUE

      @param  None.
      @return None.
      @throw  None.
      <I><B>Experimental Interface</B></I><BR>
  */
  void setNull();

  /**
      Returns whether the value has been resolved to a primitive.

      @param  None.
      @return True when value is a primitive.
      @throw  None.
      <I><B>Experimental Interface</B></I><BR>
  */
  Boolean isResolved() const;

  /**
      Returns whether the CQLValue is null.

      @param  None.
      @return True if CQLValue primitive value is NULL.
      @throw  None.
      <I><B>Experimental Interface</B></I><BR>
  */
  Boolean isNull() const;

  /** This will test to determine if the CQLValue isa String contained in the cid,
      that identifies a class. The CQLValue must be of a type Instance or Class; Also
      the cid must contain a String that is a valid class name.

      @param  cid Contains the class name.
      @param  QueryCtx Contains query related data.
      @return true CQLValue isa class identified by cid.
      @throw  None.
      <I><B>Experimental Interface</B></I><BR>
  */
  Boolean isa(const CQLChainedIdentifier& cid, QueryContext& QueryCtx) const;

  /** 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.

      @param  inVal CQLValue to be compared.
      @return true CQLValue is like the passed in CQLValue.
      @throw  None.
      <I><B>Experimental Interface</B></I><BR>
  */
  Boolean like(const CQLValue& inVal) const;

  /**
      Get the ChainedIdentifier. Primitive from CQLValue

      @param  None.
      @return ChainedIdentifier.
      @throw  CQLRuntimeException.
      <I><B>Experimental Interface</B></I><BR>
  */
  CQLChainedIdentifier getChainedIdentifier() const;

  /**
      Get the Uint64.  Primitive from CQLValue

      @param  None.
      @return Uint64.
      @throw  CQLRuntimeException.
      <I><B>Experimental Interface</B></I><BR>
  */
  Uint64 getUint() const;

  /**
      Get the Sint64. Primitive from CQLValue.

      @param  None.
      @return Sint64.
      @throw  CQLRuntimeException.
      <I><B>Experimental Interface</B></I><BR>
  */
  Sint64 getSint() const;

  /**
      Get the Real64. Primitive from CQLValue.

      @param  None.
      @return Real64.
      @throw  CQLRuntimeException.
      <I><B>Experimental Interface</B></I><BR>
  */
  Real64 getReal() const;

  /**
      Get the String. Primitive from CQLValue

      @param  None.
      @return String.
      @throw  CQLRuntimeException.
      <I><B>Experimental Interface</B></I><BR>
  */
  String getString() const;

  /**
      Get the Boolean. Primitive from CQLValue

      @param  None.
      @return Boolean
      @throw  CQLRuntimeException.
      <I><B>Experimental Interface</B></I><BR>
  */
  Boolean getBool() const;

  /**
      Get the CIMDateTime. Primitive from CQLValue.

      @param  None.
      @return CIMDateTime
      @throw  CQLRuntimeException.
      <I><B>Experimental Interface</B></I><BR>
  */
  CIMDateTime getDateTime() const;

  /**
      Get the CIMObjectPath. Primitive from CQLValue.

      @param  None.
      @return Reference.
      @throw  CQLRuntimeException.
      <I><B>Experimental Interface</B></I><BR>
  */
  CIMObjectPath getReference() const;

  /**
      Get the CIMObject. Primitive from CQLValue.

      @param  None.
      @return CIMObject.
      @throw  CQLRuntimeException.
      <I><B>Experimental Interface</B></I><BR>
  */
  CIMObject getObject() const;

  /**
      Return String representation of object.

      @param  None.
      @return String
      @throw  None.
      <I><B>Experimental Interface</B></I><BR>
  */
  String toString() const;

  /**
      Apply scope and class to CQLValue's chainedIdentifier.

      @param  None.
      @return None.
      @throw  None.
      <I><B>Experimental Interface</B></I><BR>
  */
  void applyContext(const QueryContext& _ctx,
            const CQLChainedIdentifier& inCid);

  friend class CQLFactory;

private:

  CQLValueRep *_rep;
};

/*
#ifndef PEGASUS_ARRAY_T
#define PEGASUS_ARRAY_T CQLValue
#include <Pegasus/Common/ArrayInter.h>
#undef PEGASUS_ARRAY_T
#endif
*/

PEGASUS_NAMESPACE_END
#endif
#endif /* CQLVALUE_H */

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2