コード例 #1
0
void ExceptionsTest::initialize(CIMOMHandle & cimom)
{

    cout <<" ExceptionsTest::initialize" << endl;

    CheckExceptionType(EXCEPTION_TYPE);

    // create default instances for FirstClass
    CIMInstance instance1("FirstClass");
    CIMObjectPath reference1("FirstClass.Id=1");

    instance1.addProperty(CIMProperty("Id", Uint8(1)));   // key
    instance1.addProperty(CIMProperty("Message", String("Subodh.....")));

    _instances.append(instance1);
    _instanceNames.append(reference1);

    CheckExceptionType(EXCEPTION_TYPE);

    CIMInstance instance2("FirstClass");
    CIMObjectPath reference2("FirstClass.Id=2");

    instance2.addProperty(CIMProperty("Id", Uint8(2)));   // key
    instance2.addProperty(CIMProperty("Message", String("Soni....")));

    _instances.append(instance2);
    _instanceNames.append(reference2);

    CheckExceptionType(EXCEPTION_TYPE);

    // create default instances for SecondClass
    CIMInstance instance_1("SecondClass");
    CIMObjectPath reference_1("SecondClass.Srno=11");

    instance_1.addProperty(CIMProperty("Srno", Uint8(1)));   // key
    instance_1.addProperty(
        CIMProperty("Name", String("Class Two Instance 1.....")));

    _instances_second.append(instance_1);
    _instanceNames_second.append(reference_1);

    CheckExceptionType(EXCEPTION_TYPE);

    CIMInstance instance_2("SecondClass");
    CIMObjectPath reference_2("SecondClass.Srno=2");

    instance_2.addProperty(CIMProperty("Srno", Uint8(2)));   // key
    instance_2.addProperty(
        CIMProperty("Name", String("Class Two Instance 2....")));

    _instances_second.append(instance_2);
    _instanceNames_second.append(reference_2);

    CheckExceptionType(EXCEPTION_TYPE);
}
コード例 #2
0
ファイル: TimingProvider.cpp プロジェクト: brunolauze/pegasus
void TimingProvider::initialize(CIMOMHandle & cimom)
{
    cout <<" TimingProvider::initialize" << endl;

    // Create Instances for TimeOne Class
    CIMInstance instance1("TimeOne");
    CIMObjectPath reference1("TimeOne.Id=1");

    instance1.addProperty(CIMProperty("Id", Uint8(1)));   // key
    instance1.addProperty(CIMProperty("Message", String("Class One I1")));

    _instances.append(instance1);
    _instanceNames.append(reference1);


    CIMInstance instance2("TimeOne");
    CIMObjectPath reference2("TimeOne.Id=2");

    instance2.addProperty(CIMProperty("Id", Uint8(2)));   // key
    instance2.addProperty(CIMProperty("Message", String("Class One I2")));

    _instances.append(instance2);
    _instanceNames.append(reference2);

    // Create Instances for TimeTwo Class
     CIMInstance instance_1("TimeTwo");
     CIMObjectPath reference_1("TimeTwo.Srno=22");

    instance_1.addProperty(CIMProperty("Srno", Uint8(1)));   // key
    instance_1.addProperty(CIMProperty("TimeVar", Uint16(1111)));
    _instances_2.append(instance_1);
    _instanceNames_2.append(reference_1);

    CIMInstance instance_2("TimeTwo");
    CIMObjectPath reference_2("TimeTwo.Srno=2");

    instance_2.addProperty(CIMProperty("Srno", Uint8(2)));   // key
    instance_2.addProperty(CIMProperty("TimeVar", Uint16(2222)));

    _instances_2.append(instance_2);
    _instanceNames_2.append(reference_2);
}