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

Diff for /pegasus/src/Pegasus/Common/CIMObjectRep.h between version 1.5 and 1.36

version 1.5, 2002/03/30 19:09:55 version 1.36, 2008/10/22 08:19:40
Line 1 
Line 1 
 //%/////////////////////////////////////////////////////////////////////////////  //%2006////////////////////////////////////////////////////////////////////////
 // //
 // Copyright (c) 2000, 2001 The Open group, BMC Software, Tivoli Systems, IBM  // 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 // 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
Line 20 
Line 29 
 // //
 //============================================================================== //==============================================================================
 // //
 // Author: Mike Brasher (mbrasher@bmc.com)  
 //  
 // Modified By:  
 //  
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
  
 #ifndef Pegasus_CIMObjectRep_h #ifndef Pegasus_CIMObjectRep_h
 #define Pegasus_CIMObjectRep_h #define Pegasus_CIMObjectRep_h
  
 #include <Pegasus/Common/Config.h> #include <Pegasus/Common/Config.h>
   #include <Pegasus/Common/Linkage.h>
 #include <Pegasus/Common/String.h> #include <Pegasus/Common/String.h>
   #include <Pegasus/Common/CIMName.h>
 #include <Pegasus/Common/CIMProperty.h> #include <Pegasus/Common/CIMProperty.h>
 #include <Pegasus/Common/CIMQualifier.h> #include <Pegasus/Common/CIMQualifier.h>
   #include <Pegasus/Common/CIMQualifierList.h>
 #include <Pegasus/Common/Array.h> #include <Pegasus/Common/Array.h>
   #include <Pegasus/Common/OrderedSet.h>
   #include <Pegasus/Common/CIMPropertyRep.h>
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
  
Line 44 
Line 54 
  
     This class contains what is common to CIMClass and CIMInstance.     This class contains what is common to CIMClass and CIMInstance.
 */ */
 class PEGASUS_COMMON_LINKAGE CIMObjectRep : public Sharable  class CIMObjectRep
 { {
 public: public:
  
     CIMObjectRep(const CIMReference& className);      CIMObjectRep(const CIMObjectPath& className);
  
     virtual ~CIMObjectRep();     virtual ~CIMObjectRep();
  
     const String& getClassName() const      const CIMName& getClassName() const
     {     {
         return _reference.getClassName();         return _reference.getClassName();
     }     }
  
         const CIMReference& getPath() const      const CIMObjectPath& getPath() const
     {     {
         return _reference;         return _reference;
     }     }
  
       /**
         Sets the object path for the object
         @param  path  CIMObjectPath containing the object path
        */
       void setPath (const CIMObjectPath & path);
   
     void addQualifier(const CIMQualifier& qualifier)     void addQualifier(const CIMQualifier& qualifier)
     {     {
         _qualifiers.add(qualifier);         _qualifiers.add(qualifier);
     }     }
  
     Uint32 findQualifier(const String& name) const      Uint32 findQualifier(const CIMName& name) const
     {     {
         return _qualifiers.find(name);         return _qualifiers.find(name);
     }     }
  
     Boolean existsQualifier(const String& name) const      CIMQualifier getQualifier(Uint32 index)
     {     {
         return ((_qualifiers.find(name) != PEG_NOT_FOUND) ? true : false);          return _qualifiers.getQualifier(index);
     }     }
  
     CIMQualifier getQualifier(Uint32 pos)      CIMConstQualifier getQualifier(Uint32 index) const
     {     {
         return _qualifiers.getQualifier(pos);          return _qualifiers.getQualifier(index);
     }     }
  
     CIMConstQualifier getQualifier(Uint32 pos) const      Boolean isTrueQualifer(CIMName& name) const
     {  
         return _qualifiers.getQualifier(pos);  
     }  
   
     Boolean isTrueQualifer(String& name) const  
     {     {
         return _qualifiers.isTrue(name);         return _qualifiers.isTrue(name);
     }     }
Line 97 
Line 108 
         return _qualifiers.getCount();         return _qualifiers.getCount();
     }     }
  
     void removeQualifier(Uint32 pos)      void removeQualifier(Uint32 index)
     {     {
         _qualifiers.removeQualifier(pos);          _qualifiers.removeQualifier(index);
     }     }
  
     virtual void addProperty(const CIMProperty& x);     virtual void addProperty(const CIMProperty& x);
  
     Uint32 findProperty(const String& name);      Uint32 findProperty(const CIMName& name, Uint32 nameTag) const
   
     Uint32 findProperty(const String& name) const  
     {     {
         return ((CIMObjectRep*)this)->findProperty(name);          return _properties.find(name, nameTag);
     }     }
  
     Boolean existsProperty(const String& name);      Uint32 findProperty(const CIMName& name) const
   
     Boolean existsProperty(const String& name) const  
     {     {
         return ((CIMObjectRep*)this)->existsProperty(name);          return _properties.find(name, generateCIMNameTag(name));
     }     }
  
     CIMProperty getProperty(Uint32 pos);      CIMProperty getProperty(Uint32 index)
       {
           return _properties[index];
       }
  
     CIMConstProperty getProperty(Uint32 pos) const      CIMConstProperty getProperty(Uint32 index) const
     {     {
         return ((CIMObjectRep*)this)->getProperty(pos);          return ((CIMObjectRep*)this)->getProperty(index);
     }     }
  
     void removeProperty(Uint32 pos);      void removeProperty(Uint32 index)
       {
           _properties.remove(index);
       }
  
     Uint32 getPropertyCount() const;      Uint32 getPropertyCount() const
       {
           return _properties.size();
       }
  
     virtual Boolean identical(const CIMObjectRep* x) const;     virtual Boolean identical(const CIMObjectRep* x) const;
  
     virtual void toXml(Array<Sint8>& out) const = 0;      virtual CIMObjectRep* clone() const = 0;
  
     virtual void print(PEGASUS_STD(ostream)& os = PEGASUS_STD(cout)) const = 0;      void Inc()
       {
          _refCounter++;
       }
  
     virtual CIMObjectRep* clone() const = 0;      void Dec()
       {
           if (_refCounter.decAndTestIfZero())
               delete this;
       }
  
 protected: protected:
  
     CIMObjectRep();  
   
     CIMObjectRep(const CIMObjectRep& x);     CIMObjectRep(const CIMObjectRep& x);
  
     CIMObjectRep& operator=(const CIMObjectRep& x)      CIMObjectPath _reference;
     {  
         // This method is never called.  
         return *this;  
     }  
   
     CIMReference _reference;  
     CIMQualifierList _qualifiers;     CIMQualifierList _qualifiers;
     Array<CIMProperty> _properties;      typedef OrderedSet<CIMProperty,
     Boolean _resolved;                         CIMPropertyRep,
                          PEGASUS_PROPERTY_ORDEREDSET_HASHSIZE> PropertySet;
       PropertySet _properties;
   
   private:
   
       CIMObjectRep();    // Unimplemented
       CIMObjectRep& operator=(const CIMObjectRep& x);    // Unimplemented
   
       // reference counter as member to avoid
       // virtual function resolution overhead
       AtomicInt _refCounter;
  
     friend class CIMObject;     friend class CIMObject;
       friend class BinaryStreamer;
 }; };
  
 PEGASUS_NAMESPACE_END PEGASUS_NAMESPACE_END


Legend:
Removed from v.1.5  
changed lines
  Added in v.1.36

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2