OW_CIMQualifier.hpp

Go to the documentation of this file.
00001 /*******************************************************************************
00002 * Copyright (C) 2001-2004 Vintela, Inc. All rights reserved.
00003 *
00004 * Redistribution and use in source and binary forms, with or without
00005 * modification, are permitted provided that the following conditions are met:
00006 *
00007 *  - Redistributions of source code must retain the above copyright notice,
00008 *    this list of conditions and the following disclaimer.
00009 *
00010 *  - Redistributions in binary form must reproduce the above copyright notice,
00011 *    this list of conditions and the following disclaimer in the documentation
00012 *    and/or other materials provided with the distribution.
00013 *
00014 *  - Neither the name of Vintela, Inc. nor the names of its
00015 *    contributors may be used to endorse or promote products derived from this
00016 *    software without specific prior written permission.
00017 *
00018 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
00019 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00020 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00021 * ARE DISCLAIMED. IN NO EVENT SHALL Vintela, Inc. OR THE CONTRIBUTORS
00022 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
00023 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
00024 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
00025 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
00026 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
00027 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00028 * POSSIBILITY OF SUCH DAMAGE.
00029 *******************************************************************************/
00030 
00036 #ifndef OW_CIMQUALIFIER_HPP_INCLUDE_GUARD_
00037 #define OW_CIMQUALIFIER_HPP_INCLUDE_GUARD_
00038 #include "OW_config.h"
00039 #include "OW_CIMElement.hpp"
00040 #include "OW_COWIntrusiveReference.hpp"
00041 #include "OW_CIMFwd.hpp"
00042 #include "OW_CIMNULL.hpp"
00043 #include "OW_CIMName.hpp" // necessary for implicit conversion (const char* -> CIMName) to work
00044 
00045 namespace OW_NAMESPACE
00046 {
00047 
00053 class OW_COMMON_API CIMQualifier : public CIMElement
00054 {
00055 public:
00056    struct QUALData;
00057    // Meta qualifiers
00058    static const char* const CIM_QUAL_ASSOCIATION;
00059    static const char* const CIM_QUAL_INDICATION;
00060    // Standard qualifiers
00061    static const char* const CIM_QUAL_ABSTRACT;
00062    static const char* const CIM_QUAL_AGGREGATE;
00063    static const char* const CIM_QUAL_AGGREGATION;
00064    static const char* const CIM_QUAL_ALIAS;
00065    static const char* const CIM_QUAL_ARRAYTYPE;
00066    static const char* const CIM_QUAL_BITMAP;
00067    static const char* const CIM_QUAL_BITVALUES;
00068    static const char* const CIM_QUAL_COMPOSITION;
00069    static const char* const CIM_QUAL_COUNTER;
00070    static const char* const CIM_QUAL_DELETE;
00071    static const char* const CIM_QUAL_DEPRECATED;
00072    static const char* const CIM_QUAL_DESCRIPTION;
00073    static const char* const CIM_QUAL_DISPLAYNAME;
00074    static const char* const CIM_QUAL_DN;
00075    static const char* const CIM_QUAL_EMBEDDEDOBJECT;
00076    static const char* const CIM_QUAL_EXCEPTION;
00077    static const char* const CIM_QUAL_EXPENSIVE;
00078    static const char* const CIM_QUAL_EXPERIMENTAL;
00079    static const char* const CIM_QUAL_GAUGE;
00080    static const char* const CIM_QUAL_IFDELETED;
00081    static const char* const CIM_QUAL_IN;
00082    static const char* const CIM_QUAL_INVISIBLE;
00083    static const char* const CIM_QUAL_KEY;
00084    static const char* const CIM_QUAL_LARGE;
00085    static const char* const CIM_QUAL_MAPPINGSTRINGS;
00086    static const char* const CIM_QUAL_MAX;
00087    static const char* const CIM_QUAL_MAXLEN;
00088    static const char* const CIM_QUAL_MAXVALUE;
00089    static const char* const CIM_QUAL_MIN;
00090    static const char* const CIM_QUAL_MINLEN;
00091    static const char* const CIM_QUAL_MINVALUE;
00092    static const char* const CIM_QUAL_MODELCORRESPONDENCE;
00093    static const char* const CIM_QUAL_NONLOCAL;
00094    static const char* const CIM_QUAL_NONLOCALTYPE;
00095    static const char* const CIM_QUAL_NULLVALUE;
00096    static const char* const CIM_QUAL_OCTETSTRING;
00097    static const char* const CIM_QUAL_OUT;
00098    static const char* const CIM_QUAL_OVERRIDE;
00099    static const char* const CIM_QUAL_PROPAGATED;
00100    static const char* const CIM_QUAL_PROPERTYUSAGE;
00101    static const char* const CIM_QUAL_READ;
00102    static const char* const CIM_QUAL_REQUIRED;
00103    static const char* const CIM_QUAL_REVISION;
00104    static const char* const CIM_QUAL_SCHEMA;
00105    static const char* const CIM_QUAL_SOURCE;
00106    static const char* const CIM_QUAL_SOURCETYPE;
00107    static const char* const CIM_QUAL_STATIC;
00108    static const char* const CIM_QUAL_SYNTAX;
00109    static const char* const CIM_QUAL_SYNTAXTYPE;
00110    static const char* const CIM_QUAL_TERMINAL;
00111    static const char* const CIM_QUAL_TRIGGERTYPE;
00112    static const char* const CIM_QUAL_UNITS;
00113    static const char* const CIM_QUAL_UNKNOWNVALUES;
00114    static const char* const CIM_QUAL_UNSUPPORTEDVALUES;
00115    static const char* const CIM_QUAL_VALUEMAP;
00116    static const char* const CIM_QUAL_VALUES;
00117    static const char* const CIM_QUAL_VERSION;
00118    static const char* const CIM_QUAL_WEAK;
00119    static const char* const CIM_QUAL_WRITE;
00120    static const char* const CIM_QUAL_PROVIDER;
00124    CIMQualifier();
00128    explicit CIMQualifier(CIMNULL_t);
00133    CIMQualifier(const CIMName& name);
00139    CIMQualifier(const char* name);
00144    CIMQualifier(const CIMQualifierType& qtype);
00149    CIMQualifier(const CIMQualifier& arg);
00153    ~CIMQualifier();
00157    virtual void setNull();
00163    CIMQualifier& operator= (const CIMQualifier& arg);
00167    bool isKeyQualifier() const;
00171    bool isAssociationQualifier() const;
00175    CIMValue getValue() const;
00180    CIMValue getValueT() const;
00186    CIMQualifier& setValue(const CIMValue& value);
00192    CIMQualifier& setDefaults(const CIMQualifierType& qtype);
00197    CIMQualifierType getDefaults() const;
00203    bool hasFlavor(const CIMFlavor& flavor) const;
00209    CIMQualifier& addFlavor(const CIMFlavor& flavor);
00216    CIMQualifier& removeFlavor(Int32 flavor);
00220    bool hasValue() const;
00227    bool equals(const CIMQualifier& arg) const;
00231    CIMFlavorArray getFlavor() const;
00237    CIMQualifier& setPropagated(bool propagated=true);
00241    bool getPropagated() const;
00242 
00250    CIMQualifier& setLanguage(const String& language);
00254    String getLanguage() const;
00255 
00256    typedef COWIntrusiveReference<QUALData> CIMQualifier::*safe_bool;
00257    operator safe_bool () const
00258       {  return m_pdata ? &CIMQualifier::m_pdata : 0; }
00259    bool operator!() const
00260       {  return !m_pdata; }
00264    virtual String getName() const;
00269    virtual void setName(const CIMName& name);
00270    
00275    virtual void readObject(std::istream &istrm);
00280    virtual void writeObject(std::ostream &ostrm) const;
00284    virtual String toMOF() const;
00288    virtual String toString() const;
00292    static CIMQualifier createKeyQualifier();
00293 
00298    enum { SERIALIZATION_VERSION = 1 };
00299 
00300 private:
00301 
00302 #ifdef OW_WIN32
00303 #pragma warning (push)
00304 #pragma warning (disable: 4251)
00305 #endif
00306 
00307    COWIntrusiveReference<QUALData> m_pdata;
00308 
00309 #ifdef OW_WIN32
00310 #pragma warning (pop)
00311 #endif
00312 
00313    friend OW_COMMON_API bool operator<(const CIMQualifier& x, const CIMQualifier& y);
00314 };
00315 
00316 } // end namespace OW_NAMESPACE
00317 
00318 #endif

Generated on Thu Feb 9 08:47:54 2006 for openwbem by  doxygen 1.4.6