version 1.12, 2001/07/10 22:31:09
|
version 1.37, 2002/08/15 15:52:29
|
|
|
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
// | // |
// Copyright (c) 2000, 2001 The Open group, BMC Software, Tivoli Systems, IBM |
// Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM, |
|
// The Open Group, Tivoli Systems |
// | // |
// Permission is hereby granted, free of charge, to any person obtaining a copy | // Permission is hereby granted, free of charge, to any person obtaining a copy |
// of this software and associated documentation files (the "Software"), to | // of this software and associated documentation files (the "Software"), to |
|
|
// | // |
// Author: Mike Brasher (mbrasher@bmc.com) | // Author: Mike Brasher (mbrasher@bmc.com) |
// | // |
// Modified By: |
// Modified By: Karl Schopmeyer (k.schopmeyer@opengroup.org) |
|
// Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com) |
|
// Carol Ann Krug Graves, Hewlett-Packard Company |
|
// (carolann_graves@hp.com) |
// | // |
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
/* | /* |
CIMQualifier.h - Defines the CIM qualifiers class. | CIMQualifier.h - Defines the CIM qualifiers class. |
This class represents a CIM qualifiers. It is almost identical to |
|
CIMQualifierDecl except that it has no scope member. |
|
| |
*/ | */ |
| |
|
|
#define Pegasus_Qualifier_h | #define Pegasus_Qualifier_h |
| |
#include <Pegasus/Common/Config.h> | #include <Pegasus/Common/Config.h> |
#include <Pegasus/Common/CIMQualifierRep.h> |
#include <Pegasus/Common/Linkage.h> |
|
#include <Pegasus/Common/CIMName.h> |
|
#include <Pegasus/Common/CIMFlavor.h> |
|
#include <Pegasus/Common/CIMType.h> |
|
#include <Pegasus/Common/CIMValue.h> |
| |
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
|
|
| |
class CIMConstQualifier; | class CIMConstQualifier; |
class CIMClassRep; | class CIMClassRep; |
|
class Resolver; |
|
#if defined(PEGASUS_PLATFORM_AIX_RS_IBMCXX) || defined(PEGASUS_PLATFORM_ZOS_ZSERIES_IBM) |
|
class CIMQualifierRep; |
|
#endif |
| |
/** Class CIMQualifier - This class defines the Pegasus implementation of the | /** Class CIMQualifier - This class defines the Pegasus implementation of the |
CIM CIMQualifier \Ref{QUALIFIER}. |
CIM Qualifier \Ref{QUALIFIER}. It is almost identical to |
|
CIMQualifierDecl except that it has no scope member. \Ref{CIMQualifierDecl} |
|
This includes functions to create qualifiers and manipulate/test |
|
the individual components of the CIMQualifier. |
|
CIMQualifiers are accumulated into lists for use in CIMClasses and CIM |
|
Properties using the CIMQualifierList Class and its |
|
functions. \Ref{CIMQualifierList} |
*/ | */ |
class PEGASUS_COMMON_LINKAGE CIMQualifier | class PEGASUS_COMMON_LINKAGE CIMQualifier |
{ | { |
|
|
fields.Constructor | fields.Constructor |
@return instantiated empty qualifier object | @return instantiated empty qualifier object |
*/ | */ |
CIMQualifier() : _rep(0) |
CIMQualifier(); |
{ |
|
|
|
} |
|
| |
/** Constructor - instantiates a CIM qualifier object from another | /** Constructor - instantiates a CIM qualifier object from another |
qualifier object. | qualifier object. |
@param CIM CIMQualifier object | @param CIM CIMQualifier object |
ATTN: What is differenc from clone? |
|
@return - Instantiated qualifier object | @return - Instantiated qualifier object |
*/ | */ |
CIMQualifier(const CIMQualifier& x) |
CIMQualifier(const CIMQualifier& x); |
{ |
|
Inc(_rep = x._rep); |
|
} |
|
/** Constructor - Instantiates a CIM qualifier object with the parameters | /** Constructor - Instantiates a CIM qualifier object with the parameters |
defined on input. | defined on input. |
@param String representing CIMName for the new qualifier |
@param CIMName representing CIMName for the new qualifier |
@param value | @param value |
@param flavor - ATTN: |
@param flavor - Flavor defined for this qualifier definition. Default |
@param propoagated - ATTN: |
for this parameter is CIMFlavor::NONE. |
@return -Returns the instantiated qualifier object or throws an exception |
@param propagated - Boolean defining whether this is a propagated |
if the name argument is illegal |
qualifier. This is an optional parameter with default = false |
|
@return -Returns the instantiated qualifier object |
@exception Throws IllegalName if name argument not legal CIM |
|
identifier. |
|
*/ | */ |
CIMQualifier( | CIMQualifier( |
const String& name, |
const CIMName& name, |
const CIMValue& value, | const CIMValue& value, |
Uint32 flavor = CIMFlavor::DEFAULTS, |
const CIMFlavor & flavor = CIMFlavor (CIMFlavor::NONE), |
Boolean propagated = false) |
Boolean propagated = false); |
{ |
|
_rep = new CIMQualifierRep(name, value, flavor, propagated); |
|
} |
|
/// destructor |
|
~CIMQualifier() |
|
{ |
|
Dec(_rep); |
|
} |
|
/// operator |
|
CIMQualifier& operator=(const CIMQualifier& x) |
|
{ |
|
if (x._rep != _rep) |
|
{ |
|
Dec(_rep); |
|
Inc(_rep = x._rep); |
|
} |
|
| |
return *this; |
/// destructor |
} |
~CIMQualifier(); |
| |
/** CIMMethod |
/// operator |
|
CIMQualifier& operator=(const CIMQualifier& x); |
| |
|
/** getName - Returns the name field from the qualifier |
|
@return CIMName containing the qualifier name. |
*/ | */ |
const String& getName() const |
const CIMName& getName() const; |
{ |
|
_checkRep(); |
|
return _rep->getName(); |
|
} |
|
| |
/** CIMMethod |
/** setName - Sets the qualifier name field in the qualifier object. |
Throws IllegalName if name argument not legal CIM identifier. |
@param name - CIMName containing the name for the qualifier |
*/ | */ |
void setName(const String& name) |
void setName(const CIMName& name); |
{ |
|
_checkRep(); |
|
_rep->setName(name); |
|
} |
|
|
|
/** CIMMethod |
|
| |
|
/** getType - Gets the type field from the qualifier object. |
|
@return CIMType containing the type for this qualifier /Ref{CIMType}. |
*/ | */ |
CIMType getType() const |
CIMType getType() const; |
{ |
|
_checkRep(); |
|
return _rep->getType(); |
|
} |
|
|
|
/** CIMMethod |
|
| |
|
/** isArray - Returns true if the qualifier is an array |
|
@return Boolean true if array qualifier. |
*/ | */ |
Boolean isArray() const |
Boolean isArray() const; |
{ |
|
_checkRep(); |
|
return _rep->isArray(); |
|
} |
|
|
|
/** CIMMethod |
|
| |
|
/** getValue - Gets the value component of the qualifier object |
|
@return CIMValue containing the value component |
*/ | */ |
const CIMValue& getValue() const |
const CIMValue& getValue() const; |
{ |
|
_checkRep(); |
|
return _rep->getValue(); |
|
} |
|
|
|
/** CIMMethod |
|
| |
|
/** setValue - Puts a CIMValue object into a CIMQualifier object |
|
@param value - The CIMValue object to install |
*/ | */ |
void setValue(const CIMValue& value) |
void setValue(const CIMValue& value); |
{ |
|
_checkRep(); |
|
_rep->setValue(value); |
|
} |
|
|
|
/** CIMMethod |
|
| |
|
/** setFlavor - Sets the bits defined on input into the Flavor variable |
|
for the Qualifier Object. |
|
@param flavor - CIMFlavor object defines the flavor bits to be set. |
*/ | */ |
Uint32 getFlavor() const |
void setFlavor(const CIMFlavor & flavor); |
{ |
|
_checkRep(); |
|
return _rep->getFlavor(); |
|
} |
|
|
|
/** CIMMethod |
|
| |
|
/** unsetFlavor - Resets the bits defined for the flavor |
|
for the Qualifier Object with the input. |
|
@param flavor - Uint32 defines the flavor bits to be unset. |
*/ | */ |
const Uint32 getPropagated() const |
void unsetFlavor(const CIMFlavor & flavor); |
{ |
|
_checkRep(); |
|
return _rep->getPropagated(); |
|
} |
|
|
|
/** CIMMethod |
|
| |
|
/** getFlavor - Gets the Flavor field from a Qualifier |
|
@return - CIMFlavor object |
*/ | */ |
void setPropagated(Boolean propagated) |
const CIMFlavor & getFlavor() const; |
{ |
|
_checkRep(); |
|
_rep->setPropagated(propagated); |
|
} |
|
|
|
/** CIMMethod |
|
| |
|
/** getPropagated returns the propagated indicator |
|
@return Uint32 - TBD |
*/ | */ |
operator int() const { return _rep != 0; } |
const Uint32 getPropagated() const; |
|
|
/** CIMMethod |
|
| |
|
/** setPropagated - Sets the Propagated flag for the object. |
*/ | */ |
void toXml(Array<Sint8>& out) const |
void setPropagated(Boolean propagated); |
{ |
|
_checkRep(); |
|
_rep->toXml(out); |
|
} |
|
| |
/** CIMMethod |
/** |
|
Determines if the object has not been initialized. |
| |
|
@return True if the object has not been initialized, |
|
False otherwise |
*/ | */ |
void print(PEGASUS_STD(ostream) &o=PEGASUS_STD(cout)) const |
Boolean isUninitialized() const; |
{ |
|
_checkRep(); |
|
_rep->print(o); |
|
} |
|
|
|
/** CIMMethod |
|
| |
|
/** identical - compares two CIMQualifier objects. |
|
@return - True if the objects are identical. |
*/ | */ |
Boolean identical(const CIMConstQualifier& x) const; | Boolean identical(const CIMConstQualifier& x) const; |
| |
/** CIMMethod |
/** clone Creates an exact copy of the qualifier and returns the |
|
new object. |
|
@return CIMQualifier New Qualifier object. |
*/ | */ |
CIMQualifier clone() const |
CIMQualifier clone() const; |
{ |
|
return CIMQualifier(_rep->clone()); |
|
} |
|
| |
private: | private: |
| |
CIMQualifier(CIMQualifierRep* rep) : _rep(rep) |
CIMQualifier(CIMQualifierRep* rep); |
{ |
|
} |
|
| |
void _checkRep() const |
void _checkRep() const; |
{ |
|
if (!_rep) |
|
ThrowUnitializedHandle(); |
|
} |
|
| |
CIMQualifierRep* _rep; | CIMQualifierRep* _rep; |
|
|
friend class CIMConstQualifier; | friend class CIMConstQualifier; |
friend class CIMClassRep; | friend class CIMClassRep; |
|
friend class Resolver; |
|
friend class XmlWriter; |
|
friend class MofWriter; |
}; | }; |
| |
//////////////////////////////////////////////////////////////////////////////// | //////////////////////////////////////////////////////////////////////////////// |
|
|
{ | { |
public: | public: |
| |
CIMConstQualifier() : _rep(0) |
CIMConstQualifier(); |
{ |
|
|
|
} |
|
| |
CIMConstQualifier(const CIMConstQualifier& x) |
CIMConstQualifier(const CIMConstQualifier& x); |
{ |
|
Inc(_rep = x._rep); |
|
} |
|
| |
CIMConstQualifier(const CIMQualifier& x) |
CIMConstQualifier(const CIMQualifier& x); |
{ |
|
Inc(_rep = x._rep); |
|
} |
|
|
|
// Throws IllegalName if name argument not legal CIM identifier. |
|
| |
CIMConstQualifier( | CIMConstQualifier( |
const String& name, |
const CIMName& name, |
const CIMValue& value, | const CIMValue& value, |
Uint32 flavor = CIMFlavor::DEFAULTS, |
const CIMFlavor & flavor = CIMFlavor (CIMFlavor::NONE), |
Boolean propagated = false) |
Boolean propagated = false); |
{ |
|
_rep = new CIMQualifierRep(name, value, flavor, propagated); |
|
} |
|
|
|
~CIMConstQualifier() |
|
{ |
|
Dec(_rep); |
|
} |
|
|
|
CIMConstQualifier& operator=(const CIMConstQualifier& x) |
|
{ |
|
if (x._rep != _rep) |
|
{ |
|
Dec(_rep); |
|
Inc(_rep = x._rep); |
|
} |
|
|
|
return *this; |
|
} |
|
| |
CIMConstQualifier& operator=(const CIMQualifier& x) |
~CIMConstQualifier(); |
{ |
|
if (x._rep != _rep) |
|
{ |
|
Dec(_rep); |
|
Inc(_rep = x._rep); |
|
} |
|
| |
return *this; |
CIMConstQualifier& operator=(const CIMConstQualifier& x); |
} |
|
| |
const String& getName() const |
CIMConstQualifier& operator=(const CIMQualifier& x); |
{ |
|
_checkRep(); |
|
return _rep->getName(); |
|
} |
|
| |
CIMType getType() const |
const CIMName& getName() const; |
{ |
|
_checkRep(); |
|
return _rep->getType(); |
|
} |
|
| |
Boolean isArray() const |
CIMType getType() const; |
{ |
|
_checkRep(); |
|
return _rep->isArray(); |
|
} |
|
| |
const CIMValue& getValue() const |
Boolean isArray() const; |
{ |
|
_checkRep(); |
|
return _rep->getValue(); |
|
} |
|
| |
const Uint32 getFlavor() const |
const CIMValue& getValue() const; |
{ |
|
_checkRep(); |
|
return _rep->getFlavor(); |
|
} |
|
| |
const Uint32 getPropagated() const |
const CIMFlavor & getFlavor() const; |
{ |
|
_checkRep(); |
|
return _rep->getPropagated(); |
|
} |
|
| |
operator int() const { return _rep != 0; } |
const Uint32 getPropagated() const; |
| |
void toXml(Array<Sint8>& out) const |
Boolean isUninitialized() const; |
{ |
|
_checkRep(); |
|
_rep->toXml(out); |
|
} |
|
| |
void print(PEGASUS_STD(ostream) &o=PEGASUS_STD(cout)) const |
Boolean identical(const CIMConstQualifier& x) const; |
{ |
|
_checkRep(); |
|
_rep->print(o); |
|
} |
|
|
|
Boolean identical(const CIMConstQualifier& x) const |
|
{ |
|
x._checkRep(); |
|
_checkRep(); |
|
return _rep->identical(x._rep); |
|
} |
|
| |
CIMQualifier clone() const |
CIMQualifier clone() const; |
{ |
|
return CIMQualifier(_rep->clone()); |
|
} |
|
| |
private: | private: |
| |
void _checkRep() const |
void _checkRep() const; |
{ |
|
if (!_rep) |
|
ThrowUnitializedHandle(); |
|
} |
|
| |
CIMQualifierRep* _rep; | CIMQualifierRep* _rep; |
|
|
friend class CIMQualifier; | friend class CIMQualifier; |
|
friend class XmlWriter; |
|
friend class MofWriter; |
}; | }; |
| |
PEGASUS_MEMORY_FUNCTIONS(CIMQualifier) |
|
PEGASUS_MEMORY_FUNCTIONS(CIMQualifier*) |
|
|
|
#define PEGASUS_ARRAY_T CIMQualifier | #define PEGASUS_ARRAY_T CIMQualifier |
# include "ArrayInter.h" |
# include <Pegasus/Common/ArrayInter.h> |
#undef PEGASUS_ARRAY_T | #undef PEGASUS_ARRAY_T |
| |
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |