当前位置: 首页>>代码示例>>C++>>正文


C++ CIMProperty::isUninitialized方法代码示例

本文整理汇总了C++中CIMProperty::isUninitialized方法的典型用法代码示例。如果您正苦于以下问题:C++ CIMProperty::isUninitialized方法的具体用法?C++ CIMProperty::isUninitialized怎么用?C++ CIMProperty::isUninitialized使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CIMProperty的用法示例。


在下文中一共展示了CIMProperty::isUninitialized方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: handleIndication

// l10n - note: ignoring indication language
void snmpIndicationHandler::handleIndication(
    const OperationContext& context,
    const String nameSpace,
    CIMInstance& indication,
    CIMInstance& handler, 
    CIMInstance& subscription,
    ContentLanguages & contentLanguages)
{
    Array<String> propOIDs;
    Array<String> propTYPEs;
    Array<String> propVALUEs;

    CIMProperty prop;
    CIMQualifier trapQualifier;

    Uint32 qualifierPos;
    
    String propValue;

    String mapstr1;
    String mapstr2;

    PEG_METHOD_ENTER (TRC_IND_HANDLER, 
	"snmpIndicationHandler::handleIndication");

    try
    {
    	CIMClass indicationClass = _repository->getClass(
	    nameSpace, indication.getClassName(), false, true, 
	    false, CIMPropertyList());

    	Uint32 propertyCount = indication.getPropertyCount();

    	for (Uint32 i=0; i < propertyCount; i++)
    	{
	    prop = indication.getProperty(i);

	    if (!prop.isUninitialized())
            {
                CIMName propName = prop.getName();
                Uint32 propPos = indicationClass.findProperty(propName);
                if (propPos != PEG_NOT_FOUND)
                {
                    CIMProperty trapProp = indicationClass.getProperty(propPos);

                    qualifierPos = trapProp.findQualifier(CIMName ("MappingStrings"));
                    if (qualifierPos != PEG_NOT_FOUND)
                    {
		        trapQualifier = trapProp.getQualifier(qualifierPos);
		
		        mapstr1.clear();
		        mapstr1 = trapQualifier.getValue().toString();

		        if ((mapstr1.find("OID.IETF") != PEG_NOT_FOUND) &&
		            (mapstr1.find("DataType.IETF") != PEG_NOT_FOUND))
		        {
		            if (mapstr1.subString(0, 8) == "OID.IETF")
		            {
			        mapstr1 = mapstr1.subString(mapstr1.find("SNMP.")+5);
                                if (mapstr1.find("|") != PEG_NOT_FOUND)
                                {
			            mapstr2.clear();
			            mapstr2 = mapstr1.subString(0, 
				        mapstr1.find("DataType.IETF")-1);
			            propOIDs.append(mapstr2);
                            
			            propValue.clear();
                                    propValue = prop.getValue().toString();
			            propVALUEs.append(propValue);
                            
			            mapstr2 = mapstr1.subString(mapstr1.find("|")+2);
                                    mapstr2 = mapstr2.subString(0, mapstr2.size()-1);
			            propTYPEs.append(mapstr2);
                                }
		            }
		        }
	            }
                }
            }
        }

        // Collected complete data in arrays and ready to send the trap.
        // trap destination and SNMP type are defined in handlerInstance
        // and passing this instance as it is to deliverTrap() call

#ifdef HPUX_EMANATE
        static snmpDeliverTrap_emanate emanateTrap;
#else
        static snmpDeliverTrap_stub emanateTrap;
#endif

        Uint32 targetHostPos = handler.findProperty(CIMName ("TargetHost"));
        Uint32 targetHostFormatPos = handler.findProperty(CIMName ("TargetHostFormat"));
        Uint32 otherTargetHostFormatPos = handler.findProperty(CIMName (
				      "OtherTargetHostFormat"));
        Uint32 portNumberPos = handler.findProperty(CIMName ("PortNumber"));
        Uint32 snmpVersionPos = handler.findProperty(CIMName ("SNMPVersion"));
        Uint32 securityNamePos =  handler.findProperty(CIMName ("SNMPSecurityName"));
        Uint32 engineIDPos =  handler.findProperty(CIMName ("SNMPEngineID"));
//.........这里部分代码省略.........
开发者ID:ncultra,项目名称:Pegasus-2.5,代码行数:101,代码来源:snmpIndicationHandler.cpp

示例2: test01

void test01()
{
    CIMProperty pnull;

    PEGASUS_TEST_ASSERT(pnull.isUninitialized());

    CIMProperty p1(CIMName ("message"), String("Hi There"));
    p1.addQualifier(CIMQualifier(CIMName ("Key"), true));
    p1.addQualifier(CIMQualifier(CIMName ("stuff"), true));
    p1.addQualifier(CIMQualifier(CIMName ("stuff2"), true));
    p1.addQualifier(CIMQualifier(CIMName ("Description"), String("Blah Blah")));
    CIMConstProperty p2 = p1;

    // Test clone
    CIMProperty p1clone = p1.clone();
    CIMProperty p2clone = p2.clone();
   
    // Test print

    if(verbose)
    {
       XmlWriter::printPropertyElement(p1, cout);
       XmlWriter::printPropertyElement(p2, cout);
       XmlWriter::printPropertyElement(p1clone, cout);
       XmlWriter::printPropertyElement(p2clone, cout);
    }

    // Test toMof
       Buffer mofOut;
       MofWriter::appendPropertyElement(true, mofOut, p1);
       MofWriter::appendPropertyElement(true, mofOut, p2);

    // Test toXml
       Buffer xmlOut;
       XmlWriter::appendPropertyElement(xmlOut, p1);
       XmlWriter::appendPropertyElement(xmlOut, p2);

    // Test name
        CIMName name;
        name = p1.getName();
        PEGASUS_TEST_ASSERT(name == CIMName ("message"));
        name = p2.getName();
        PEGASUS_TEST_ASSERT(name == CIMName ("message"));

    // Test type
        PEGASUS_TEST_ASSERT(p1.getType() == CIMTYPE_STRING);
        PEGASUS_TEST_ASSERT(p2.getType() == CIMTYPE_STRING);

    // Test for key qualifier
        Uint32 pos;
        Boolean isKey = false;
        if ((pos = p1.findQualifier (CIMName ("key"))) != PEG_NOT_FOUND)
        {
            CIMValue value;
            value = p1.getQualifier (pos).getValue ();
            if (!value.isNull ())
            {
                value.get (isKey);
            }
        }
        PEGASUS_TEST_ASSERT (isKey);
        isKey = false;
        if ((pos = p2.findQualifier (CIMName ("key"))) != PEG_NOT_FOUND)
        {
            CIMValue value;
            value = p2.getQualifier (pos).getValue ();
            if (!value.isNull ())
            {
                value.get (isKey);
            }
        }
        PEGASUS_TEST_ASSERT (isKey);
    // Test for key property using CIMPropertyInternal
        PEGASUS_TEST_ASSERT (CIMPropertyInternal::isKeyProperty(p1));
        PEGASUS_TEST_ASSERT (CIMPropertyInternal::isKeyProperty(p2));

    // Test getArraySize
        PEGASUS_TEST_ASSERT(p1.getArraySize() == 0);
        PEGASUS_TEST_ASSERT(p2.getArraySize() == 0);

    // Test getPropagated
        PEGASUS_TEST_ASSERT(p1.getPropagated() == false);
        PEGASUS_TEST_ASSERT(p2.getPropagated() == false);

    // Tests for Qualifiers
    PEGASUS_TEST_ASSERT(p1.findQualifier(CIMName ("stuff")) != PEG_NOT_FOUND);
    PEGASUS_TEST_ASSERT(p1.findQualifier(CIMName ("stuff2")) != PEG_NOT_FOUND);
    PEGASUS_TEST_ASSERT(p1.findQualifier(CIMName ("stuff21")) == PEG_NOT_FOUND);
    PEGASUS_TEST_ASSERT(p1.findQualifier(CIMName ("stuf")) == PEG_NOT_FOUND);
    PEGASUS_TEST_ASSERT(p1.getQualifierCount() == 4);

    PEGASUS_TEST_ASSERT(p2.findQualifier(CIMName ("stuff")) != PEG_NOT_FOUND);
    PEGASUS_TEST_ASSERT(p2.findQualifier(CIMName ("stuff2")) != PEG_NOT_FOUND);
    PEGASUS_TEST_ASSERT(p2.findQualifier(CIMName ("stuff21")) == PEG_NOT_FOUND);
    PEGASUS_TEST_ASSERT(p2.findQualifier(CIMName ("stuf")) == PEG_NOT_FOUND);
    PEGASUS_TEST_ASSERT(p2.getQualifierCount() == 4);

    PEGASUS_TEST_ASSERT(p1.findQualifier(CIMName ("stuff")) != PEG_NOT_FOUND);
    PEGASUS_TEST_ASSERT(p1.findQualifier(CIMName ("stuff2")) != PEG_NOT_FOUND);

//.........这里部分代码省略.........
开发者ID:host1812,项目名称:scx_plugin_public,代码行数:101,代码来源:Property.cpp


注:本文中的CIMProperty::isUninitialized方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。