• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ PEGASUS_STD函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中PEGASUS_STD函数的典型用法代码示例。如果您正苦于以下问题:C++ PEGASUS_STD函数的具体用法?C++ PEGASUS_STD怎么用?C++ PEGASUS_STD使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: main

int main (int argc, char* argv [])
{
    MTTestClient    command = MTTestClient ();
    int                rc;

    try
    {
        command.setCommand (argc, argv);
    }
    catch (const CommandFormatException& cfe)
    {
        cerr << MTTestClient::COMMAND_NAME << ": " << cfe.getMessage ()
             << endl;
        cerr << command.getUsage () << endl;
        exit (Command::RC_ERROR);
    }
    catch (const Exception& e)
    {
        cerr << MTTestClient::COMMAND_NAME << ": " << e.getMessage ()
             << endl;
    }

    rc = command.execute (cout, cerr);

    PEGASUS_STD(cout) <<  "+++++ passed all tests" << PEGASUS_STD(endl);
    exit (rc);
    return 0;
}
开发者ID:deleisha,项目名称:neopegasus,代码行数:28,代码来源:MTTestClient.cpp


示例2: main

int main (int argc, char** argv)
{
    CIMClient client;
    try
    {
        client.connectLocal ();
    }
    catch (Exception & e)
    {
        PEGASUS_STD (cerr) << e.getMessage () << PEGASUS_STD (endl);
        return -1;
    }

    if (argc != 3)
    {
        _usage ();
        return 1;
    }

    const char* opt = argv[1];
    const char* optLang = argv[2];
    String qlang(optLang);

#ifndef PEGASUS_ENABLE_CQL
    if (qlang == "DMTF:CQL")
    {
        PEGASUS_STD(cout) << "+++++ cql test disabled" << PEGASUS_STD(endl);
        return 0;
    }
#endif

    return _test(client, opt, qlang);
}
开发者ID:host1812,项目名称:scx_plugin_public,代码行数:33,代码来源:DisableEnable2.cpp


示例3: main

int main (int argc, char** argv)
{
    String stringVal;
    verbose = (getenv("PEGASUS_TEST_VERBOSE")) ? true : false;

    CIMClient client;
    try
    {
        client.connectLocal ();
    }
    catch (Exception & e)
    {
        PEGASUS_STD (cerr) << e.getMessage () << PEGASUS_STD (endl);
        return -1;
    }

    _enumerateInstanceNames(client);
    _getInstance(client);
    _setProperty(client, 7890);
    _getProperty(client);
    // getProperty() only returns CIMValues of type String.
    value.get(stringVal);
    PEGASUS_TEST_ASSERT(atoi((const char*)stringVal.getCString())==7890);
    _setProperty(client,1234);
    _getProperty(client);
    // getProperty() only returns CIMValues of type String.
    // Verify that setProperty worked as expected.
    value.get(stringVal);
    PEGASUS_TEST_ASSERT(atoi((const char*)stringVal.getCString())==1234);

    return 0;
}
开发者ID:rdobson,项目名称:openpegasus,代码行数:32,代码来源:TestCMPIProperty.cpp


示例4: _usage

void _usage ()
{
    PEGASUS_STD (cerr) 
        << "Usage: TestDisableEnable2 "
        << "{setup | setup2 | create | create2 "
        << "| sendSucceed | sendFail | sendBlock "
        << "| delete | delete2 | cleanup | cleanup2} {WQL | DMTF:CQL}" 
        << PEGASUS_STD (endl);
}
开发者ID:host1812,项目名称:scx_plugin_public,代码行数:9,代码来源:DisableEnable2.cpp


示例5: _test

int _test(CIMClient& client, const char* opt, String& qlang)
{
  if (String::equalNoCase (opt, "setup"))
  {
    _setup (client, qlang);
  }
  else if (String::equalNoCase (opt, "setup2"))
  {
    _setup2 (client, qlang);
  }
  else if (String::equalNoCase (opt, "create"))
  {
    _create (client);
  }
  else if (String::equalNoCase (opt, "create2"))
  {
    _create2 (client);
  }
  else if (String::equalNoCase (opt, "sendSucceed"))
  {
    _sendSucceed (client);
  }
  else if (String::equalNoCase (opt, "sendFail"))
  {
    _sendFail (client);
  }
  else if (String::equalNoCase (opt, "sendBlock"))
  {
    _sendBlock (client);
  }
  else if (String::equalNoCase (opt, "delete"))
  {
    _delete (client);
  }
  else if (String::equalNoCase (opt, "delete2"))
  {
    _delete2 (client);
  }
  else if (String::equalNoCase (opt, "cleanup"))
  {
    _cleanup (client);
  }
  else if (String::equalNoCase (opt, "cleanup2"))
  {
    _cleanup2 (client);
  }
  else
  {
    PEGASUS_STD (cerr) << "Invalid option: " << opt 
                       << PEGASUS_STD (endl);
    _usage ();
    return -1;
  }
  
  return 0;
}
开发者ID:host1812,项目名称:scx_plugin_public,代码行数:56,代码来源:DisableEnable2.cpp


示例6: PEGASUS_STD

void MessageQueueService::handle_CimServiceStop(CimServiceStop *req)
{
#ifdef MESSAGEQUEUESERVICE_DEBUG
   PEGASUS_STD(cout) << getQueueName() << "received STOP" << PEGASUS_STD(endl);
#endif
   // set the stopeed bit and update
   _capabilities |= module_capabilities::stopped;
   _make_response(req, async_results::CIM_STOPPED);
   // now tell the meta dispatcher we are stopped
   update_service(_capabilities, _mask);
}
开发者ID:ncultra,项目名称:Pegasus-2.5,代码行数:11,代码来源:MessageQueueService.cpp


示例7: PEGASUS_STD

void OOPModuleFailureTestProvider::invokeMethod (
    const OperationContext & context,
    const CIMObjectPath & objectReference,
    const CIMName & methodName,
    const Array <CIMParamValue> & inParameters,
    MethodResultResponseHandler & handler)
{
    Boolean sendIndication = false;
    String identifier;
    handler.processing ();

    if (objectReference.getClassName ().equal ("FailureTestIndication") &&
        _enabled)
    {
        if (methodName.equal ("SendTestIndication"))
        {
            if ((inParameters.size() > 0) &&
                (inParameters[0].getParameterName () == "identifier"))
            {
                inParameters[0].getValue().get(identifier);
            }
            sendIndication = true;
            handler.deliver (CIMValue (0));
        }
    }
    else
    {
         handler.deliver (CIMValue (1));
         PEGASUS_STD (cout) << "Provider is not enabled." <<
         PEGASUS_STD (endl);
    }

    handler.complete ();

    if (sendIndication)
    {
        _generateIndication (_handler, identifier);
    }

    //
    //  If I am the OOPModuleInvokeFailureTestProvider, fail (i.e. exit)
    //
    if (String::equalNoCase (_providerName,
        "OOPModuleInvokeFailureTestProvider"))
    {
        if (methodName.equal ("Fail"))
        {
            exit (-1);
        }
    }
}
开发者ID:rdobson,项目名称:openpegasus,代码行数:51,代码来源:OOPModuleFailureTestProvider.cpp


示例8: removeErrorInstance

int removeErrorInstance(CIMClient& client)
{
    try
    {
        client.deleteInstance(TEST_NAMESPACE, errorPath);
    }
    catch (Exception & e)
    {
        PEGASUS_STD(cout)
            << "Exception encountered while removing Error Instance: "
            << e.getMessage() << PEGASUS_STD(endl);
    }
    return 0;
}
开发者ID:rdobson,项目名称:openpegasus,代码行数:14,代码来源:EmbeddedInstanceTest.cpp


示例9: retrieveIndicationInstance

int retrieveIndicationInstance(CIMClient& client)
{
    // Approximates a timeout, each loop is roughly 1 second
    Uint32 loopCount = 0;
    while ((receivedIndications == 0) && (loopCount < MAX_COUNT))
    {
        Thread::sleep(1000);
        loopCount++;
    }

    AutoMutex a(*mut);
    Array<CIMInstance> indications;
    try
    {
        indications = client.enumerateInstances(
            TEST_NAMESPACE, "PG_InstMethodIndication");
    }
    catch (Exception& e)
    {
        cout << "Exception caught while enumerating indications: "
            << e.getMessage() << endl;
        return -1;
    }

    if (indications.size() != 5)
    {
        cout << "Expected to get one instance. Received "
            << indications.size() << endl;
        return -1;
    }

    indicationInstance.reset(new CIMInstance(indications[0]));

    if (receivedIndication.get() == 0)
    {
        PEGASUS_STD(cout) << "Did not receive indication via listener" <<
            PEGASUS_STD(endl);
        return -1;
    }

    if (!indicationInstance->identical(*receivedIndication))
    {
        PEGASUS_STD(cout)
            << "Indication instance retrieved via listener does not match "
            << "instance retrieved via enumeration" << PEGASUS_STD(endl);
        return -1;
    }

    return 0;
}
开发者ID:rdobson,项目名称:openpegasus,代码行数:50,代码来源:EmbeddedInstanceTest.cpp


示例10: main

int main(int argc, char** argv)
{
    verbose = (getenv ("PEGASUS_TEST_VERBOSE")) ? true : false;

    const char* _pegHome = getenv ("PEGASUS_HOME");
    if (_pegHome == NULL)
    {
        PEGASUS_STD (cout) << argv[0] << " +++++ tests failed: "
            << "PEGASUS_HOME environment variable must be set"
                           << PEGASUS_STD (endl);
        return -1;
    }
    ConfigManager::setPegasusHome(_pegHome);

    try
    {
        String name;
        String ver;

        name = "C++Default";
        ver = "2.1.0";
        PEGASUS_TEST_ASSERT(
            ProviderManagerMap::instance().isValidProvMgrIfc(name, ver));
        ver = "2.6.0";
        PEGASUS_TEST_ASSERT(
            ProviderManagerMap::instance().isValidProvMgrIfc(name, ver));
        name = "Junk";
        PEGASUS_TEST_ASSERT(
            !ProviderManagerMap::instance().isValidProvMgrIfc(name, ver));
#ifdef PEGASUS_ENABLE_CMPI_PROVIDER_MANAGER
        name = "CMPI";
        ver = "2.0.0";
        PEGASUS_TEST_ASSERT(
            ProviderManagerMap::instance().isValidProvMgrIfc(name, ver));
        ver = "1.2.3";
        PEGASUS_TEST_ASSERT(
            !ProviderManagerMap::instance().isValidProvMgrIfc(name, ver));
#endif
#ifdef PEGASUS_ENABLE_JMPI_PROVIDER_MANAGER
        name = "JMPI";
        ver = "2.2.0";
        PEGASUS_TEST_ASSERT(
            ProviderManagerMap::instance().isValidProvMgrIfc(name, ver));
#endif
    }
    catch(Exception& e)
    {
    PEGASUS_STD(cerr) << "Error: " << e.getMessage() << PEGASUS_STD(endl);
    PEGASUS_STD (cout) << argv[0] << " +++++ tests failed"
                       << PEGASUS_STD (endl);
    exit(-1);
    }


    PEGASUS_STD(cout) << argv[0] << " +++++ passed all tests"
                      << PEGASUS_STD(endl);

    return 0;
}
开发者ID:rdobson,项目名称:openpegasus,代码行数:59,代码来源:providerManagerMap.cpp


示例11: _sendBlock

void _sendBlock (CIMClient & client)
{
    try
    {
        _sendIndicationShouldBeBlocked (client);
    }
    catch (Exception & e)
    {
        PEGASUS_STD (cerr) << "sendBlock failed: " << e.getMessage ()
                           << PEGASUS_STD (endl);
        exit (-1);
    }

    PEGASUS_STD (cout) << "+++++ sendBlock completed successfully"
                       << PEGASUS_STD (endl);
}
开发者ID:host1812,项目名称:scx_plugin_public,代码行数:16,代码来源:DisableEnable2.cpp


示例12: _cleanup2

void _cleanup2 (CIMClient & client)
{
    try
    {
        _deleteHandlerInstance (client, String ("DEHandler02"), NAMESPACE2);
        _deleteFilterInstance (client, String ("DEFilter02"), NAMESPACE1);
    }
    catch (Exception & e)
    {
        PEGASUS_STD (cerr) << "cleanup2 failed: " << e.getMessage ()
                           << PEGASUS_STD (endl);
        exit (-1);
    }

    PEGASUS_STD (cout) << "+++++ cleanup2 completed successfully"
                       << PEGASUS_STD (endl);
}
开发者ID:host1812,项目名称:scx_plugin_public,代码行数:17,代码来源:DisableEnable2.cpp


示例13: _delete2

void _delete2 (CIMClient & client)
{
    try
    {
        _deleteSubscriptionInstance (client, String ("DEFilter02"),
            String ("DEHandler02"), NAMESPACE1, NAMESPACE2, NAMESPACE3);
    }
    catch (Exception & e)
    {
        PEGASUS_STD (cerr) << "delete2 failed: " << e.getMessage ()
                           << PEGASUS_STD (endl);
        exit (-1);
    }

    PEGASUS_STD (cout) << "+++++ delete2 completed successfully"
                       << PEGASUS_STD (endl);
}
开发者ID:host1812,项目名称:scx_plugin_public,代码行数:17,代码来源:DisableEnable2.cpp


示例14: _testDuplicate

void _testDuplicate(CIMClient &client)
{
    CIMObjectPath filterPath;
    CIMObjectPath handlerPath;
    CIMObjectPath subscriptionPath;

    try
    {
        handlerPath = CreateHandler1Instance(client,
            PEGASUS_NAMESPACENAME_INTEROP);
        filterPath = CreateFilterInstance(client,
            QUERY1, "WQL", "Filter1",
            PEGASUS_NAMESPACENAME_INTEROP);
        subscriptionPath = CreateSbscriptionInstance(client, handlerPath,
            filterPath, PEGASUS_NAMESPACENAME_INTEROP);

        _createDuplicate(client, String::EMPTY, CIMNamespaceName(),
            filterPath, String::EMPTY, CIMNamespaceName(), handlerPath);

        _createDuplicate(client, String::EMPTY,
            PEGASUS_NAMESPACENAME_INTEROP, filterPath,
            String::EMPTY,PEGASUS_NAMESPACENAME_INTEROP, handlerPath);

        _createDuplicate(client, "127.0.0.1",
            PEGASUS_NAMESPACENAME_INTEROP, filterPath,
            String::EMPTY, CIMNamespaceName(), handlerPath);

        _createDuplicate(client, "127.0.0.1",PEGASUS_NAMESPACENAME_INTEROP,
            filterPath, "127.0.0.1", PEGASUS_NAMESPACENAME_INTEROP,
            handlerPath);

        _createDuplicate(client, String::EMPTY, CIMNamespaceName(),
            filterPath, "127.0.0.1", PEGASUS_NAMESPACENAME_INTEROP,
            handlerPath);
        _checkSubscriptionCount(client);
        DeleteInstance(client, subscriptionPath, PEGASUS_NAMESPACENAME_INTEROP);
        DeleteInstance(client, filterPath, PEGASUS_NAMESPACENAME_INTEROP);
        DeleteInstance(client, handlerPath, PEGASUS_NAMESPACENAME_INTEROP);
    }
    catch (const CIMException &e)
    {
        PEGASUS_STD(cerr) << "Exception: " << e.getMessage()
                          << PEGASUS_STD (endl);
        PEGASUS_TEST_ASSERT(0);
    }
}
开发者ID:brunolauze,项目名称:pegasus,代码行数:46,代码来源:IndicationProcess.cpp


示例15: verifyCertificate

static Boolean verifyCertificate(SSLCertificateInfo &certInfo)
{

#ifdef DEBUG
    PEGASUS_STD(cout) << certInfo.getSubjectName() << endl;
#endif
    //ATTN-NB-03-05132002: Add code to handle server certificate verification.
    return true;
}
开发者ID:deleisha,项目名称:neopegasus,代码行数:9,代码来源:MTTestClient.cpp


示例16: _getInstance

void _getInstance(CIMClient & client)
{
    try
    {
        instance = client.getInstance(SOURCE_NAMESPACE, objectNames[0]);
        if (verbose)
        {
            XmlWriter::printInstanceElement(instance, PEGASUS_STD(cout));
            PEGASUS_STD (cout) << "+++++ getInstance completed successfully"
                               << PEGASUS_STD (endl);
        }
    }
    catch (Exception & e)
    {
        PEGASUS_STD (cerr) << "getInstance failed: " << e.getMessage ()
                           << PEGASUS_STD (endl);
        exit (-1);
    }
}
开发者ID:rdobson,项目名称:openpegasus,代码行数:19,代码来源:TestCMPIProperty.cpp


示例17: _testConcurrent

//
// Tests subscription creation by sending the similar concurrent subscription
// creation requests .
//
void _testConcurrent(CIMClient &client)
{
    CIMObjectPath filterPath;
    CIMObjectPath handlerPath;
    CIMObjectPath subscriptionPath;
    try
    {
        HandlerPath = CreateHandler1Instance(client,
            PEGASUS_NAMESPACENAME_INTEROP);
        FilterPath = CreateFilterInstance(client,
            QUERY1, "WQL", "Filter1",
            PEGASUS_NAMESPACENAME_INTEROP);

        Thread thread1(createSubscriptionFunc, (void *)0, false);
        Thread thread2(createSubscriptionFunc, (void *)0, false);
        Thread thread3(createSubscriptionFunc, (void *)0, false);
        Thread thread4(createSubscriptionFunc, (void *)0, false);

        thread1.run();
        thread2.run();
        thread3.run();
        thread4.run();

        thread1.join();
        thread2.join();
        thread3.join();
        thread4.join();

        _checkSubscriptionCount(client);

        PEGASUS_TEST_ASSERT(exceptionCount.get() == 3);

        DeleteInstance(client, SubscriptionPath, PEGASUS_NAMESPACENAME_INTEROP);
        DeleteInstance(client, FilterPath, PEGASUS_NAMESPACENAME_INTEROP);
        DeleteInstance(client, HandlerPath, PEGASUS_NAMESPACENAME_INTEROP);
   }
   catch(const CIMException &e)
   {
      PEGASUS_STD(cerr) << "Exception: " << e.getMessage()
                        << PEGASUS_STD (endl);
      PEGASUS_TEST_ASSERT(0);
   }
}
开发者ID:brunolauze,项目名称:pegasus,代码行数:47,代码来源:IndicationProcess.cpp


示例18: main

int main (int argc, char** argv)
{
    verbose = getenv ("PEGASUS_TEST_VERBOSE") ? true : false;

    try
    {
        test01 ();

        PEGASUS_STD (cout) << argv [0] << " +++++ passed all tests"
                           << PEGASUS_STD (endl);
    }
    catch (Exception & e)
    {
        PEGASUS_STD (cerr) << argv [0] << " Exception " << e.getMessage ()
                           << PEGASUS_STD (endl);
        exit (1);
    }
    return 0;
}
开发者ID:kaixuanlive,项目名称:openpegasus,代码行数:19,代码来源:Flavor.cpp


示例19: _create2

void _create2 (CIMClient & client)
{
    try
    {
        _createSubscriptionInstance (client, 
            _buildFilterOrHandlerPath (PEGASUS_CLASSNAME_INDFILTER, 
                "DEFilter02", NAMESPACE1),
            _buildFilterOrHandlerPath (PEGASUS_CLASSNAME_INDHANDLER_CIMXML,
                "DEHandler02", NAMESPACE2), NAMESPACE3);
    }
    catch (Exception & e)
    {
        PEGASUS_STD (cerr) << "create2 failed: " << e.getMessage ()
                           << PEGASUS_STD (endl);
        exit (-1);
    }

    PEGASUS_STD (cout) << "+++++ create2 completed successfully"
                       << PEGASUS_STD (endl);
}
开发者ID:host1812,项目名称:scx_plugin_public,代码行数:20,代码来源:DisableEnable2.cpp


示例20: switch

void MessageQueueService::handle_AsyncIoctl(AsyncIoctl *req)
{
   switch (req->ctl)
   {
      case AsyncIoctl::IO_CLOSE:
      {
         MessageQueueService *service = static_cast<MessageQueueService *>(req->op->_service_ptr);

#ifdef MESSAGEQUEUESERVICE_DEBUG
         PEGASUS_STD(cout) << service->getQueueName() << " Received AsyncIoctl::IO_CLOSE " << PEGASUS_STD(endl);
#endif

         // respond to this message. this is fire and forget, so we don't need to delete anything.
         // this takes care of two problems that were being found
         // << Thu Oct  9 10:52:48 2003 mdd >>
          _make_response(req, async_results::OK);
         // ensure we do not accept any further messages

         // ensure we don't recurse on IO_CLOSE
         if (_incoming_queue_shutdown.value() > 0)
            break;

         // set the closing flag
         service->_incoming_queue_shutdown = 1;
         // empty out the queue
         while (1)
         {
            AsyncOpNode *operation;
            try
            {
               operation = service->_incoming.remove_first();
            }
            catch(IPCException &)
            {
               break;
            }
            if (operation)
            {
               operation->_service_ptr = service;
               service->_handle_incoming_operation(operation);
            }
            else
               break;
         } // message processing loop

         // shutdown the AsyncDQueue
         service->_incoming.shutdown_queue();
         return;
      }

      default:
         _make_response(req, async_results::CIM_NAK);
   }
}
开发者ID:ncultra,项目名称:Pegasus-2.5,代码行数:54,代码来源:MessageQueueService.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ PEGASUS_TEST_ASSERT函数代码示例发布时间:2022-05-30
下一篇:
C++ PEGASUS_ASSERT函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap