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

C++ basic::Object类代码示例

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

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



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

示例1: queueIncomingMessage

//------------------------------------------------------------------------------
// queueIncomingMessage() -- Queue up an incoming message
//------------------------------------------------------------------------------
bool Datalink::queueIncomingMessage(Basic::Object* const msg)
{
   // Only queue message if Ownship is local.  IPlayer messages are processed on their local systems
   if ((getOwnship() == nullptr) || !(getOwnship()->isLocalPlayer())) {
      return true;
   }

   //if (isMessageEnabled(MSG_INFO)) {
   //std::cout << getOwnship()->getID() << "\tincomming QQueue Size: " << inQueue->entries() << std::endl;
   //}

   if(inQueue->isFull()) {
      if (isMessageEnabled(MSG_WARNING)) {
         std::cerr << "dumping 10 oldest messages in Datalink::inQueue" << std::endl;
      }

      for(int i = 0; i < 10; i++) {
         Basic::Object* obj = inQueue->get();
         obj->unref();
      } //clear out 10 oldest messages
   }
   if (msg != nullptr) {
      msg->ref();
      inQueue->put(msg);
   }
   return true;
}
开发者ID:jaegerbomb,项目名称:OpenEaagles,代码行数:30,代码来源:Datalink.cpp


示例2: builder

// DataRecordTest builder
static DataRecordTest* builder(const char* const filename)
{
   // read configuration file
   int errors = 0;
   Basic::Object* obj = Basic::lcParser(filename, Factory::createObj, &errors);
   if (errors > 0) {
      std::cerr << "File: " << filename << ", errors: " << errors << std::endl;
      std::exit(EXIT_FAILURE);
   }

   // test to see if an object was created
   if (obj == 0) {
      std::cerr << "Invalid configuration file, no objects defined!" << std::endl;
      std::exit(EXIT_FAILURE);
   }

   // do we have a Basic::Pair, if so, point to object in Pair, not Pair itself
   Basic::Pair* pair = dynamic_cast<Basic::Pair*>(obj);
   if (pair != 0) {
      obj = pair->object();
      obj->ref();
      pair->unref();
   }

   // try to cast to proper object, and check
   DataRecordTest* dataRecordTest = dynamic_cast<DataRecordTest*>(obj);
   if (dataRecordTest == 0) {
      std::cerr << "Invalid configuration file!" << std::endl;
      std::exit(EXIT_FAILURE);
   }
   return dataRecordTest;
}
开发者ID:dfileccia,项目名称:OpenEaaglesExamples,代码行数:33,代码来源:main.cpp


示例3: builder

// display builder
static Glut::GlutDisplay* builder(const char* const filename)
{
   // read configuration file
   int errors = 0;
   Basic::Object* obj = Basic::lcParser(filename, factory, &errors);
   if (errors > 0) {
      std::cerr << "File: " << filename << ", errors: " << errors << std::endl;
      std::exit(EXIT_FAILURE);
   }

   // test to see if an object was created
   if (obj == nullptr) {
      std::cerr << "Invalid configuration file, no objects defined!" << std::endl;
      std::exit(EXIT_FAILURE);
   }

   // do we have a Basic::Pair, if so, point to object in Pair, not Pair itself
   Basic::Pair* pair = dynamic_cast<Basic::Pair*>(obj);
   if (pair != nullptr) {
      obj = pair->object();
      obj->ref();
      pair->unref();
   }

   // try to cast to proper object, and check
   Glut::GlutDisplay* glutDisplay = dynamic_cast<Glut::GlutDisplay*>(obj);
   if (glutDisplay == nullptr) {
      std::cerr << "Invalid configuration file!" << std::endl;
      std::exit(EXIT_FAILURE);
   }
   return glutDisplay;
}
开发者ID:krhohio,项目名称:OpenEaaglesExamples,代码行数:33,代码来源:main.cpp


示例4: clearQueues

//------------------------------------------------------------------------------
// clearQueues() -- clear all queues
//------------------------------------------------------------------------------
void Datalink::clearQueues()
{
   Basic::Object* msg = inQueue->get();
   while (msg != 0) {
      msg->unref();
      msg = inQueue->get();
   }
   msg = outQueue->get();
   while (msg != 0) {
      msg->unref();
      msg = outQueue->get();
   }
}
开发者ID:Stupefy,项目名称:OpenEaagles,代码行数:16,代码来源:Datalink.cpp


示例5: queueOutgoingMessage

//------------------------------------------------------------------------------
// queueOutgoingMessage() -- Queue up an out going message -- 
//------------------------------------------------------------------------------
bool Datalink::queueOutgoingMessage(Basic::Object* const msg)
{
    //if (isMessageEnabled(MSG_INFO)) {
    //std::cout << getOwnship()->getID() << "\tOutgoing QQueue Size: " << outQueue->entries() << std::endl;
    //}

    if(outQueue->isFull()) {
        if (isMessageEnabled(MSG_WARNING)) {
        std::cerr << "dumping 10 oldest messages in Datalink::outQueue" << std::endl;
        }

        for(int i = 0; i < 10; i++) {
            Basic::Object* obj = outQueue->get();
            if (obj != 0) obj->unref();
        } //clear out 10 oldest messages
    }
    if (msg != 0) {
       msg->ref();
       outQueue->put(msg);
    }
    return true;
}
开发者ID:Stupefy,项目名称:OpenEaagles,代码行数:25,代码来源:Datalink.cpp


示例6: copyData

//------------------------------------------------------------------------------
// copyData() -- copy member data
//------------------------------------------------------------------------------
void SlSymbol::copyData(const SlSymbol& org, const bool cc)
{
    BaseClass::copyData(org);
    if (cc) initData();

    visibility = org.visibility;
    llFlg = org.llFlg;
    acFlg = org.acFlg;
    scrnFlg = org.scrnFlg;

    type = org.type;
    lcStrcpy(id, sizeof(id), org.id);

    xPos = org.xPos;
    yPos = org.yPos;

    xScreenPos = org.xScreenPos;
    yScreenPos = org.yScreenPos;

    hdg = org.hdg;
    hdgValid = org.hdgValid;
    setHdgGraphics(0);
    setHdgAngleObj(0);

    {
        Basic::Object* copy = 0;
        if (org.value != 0) copy = org.value->clone();
        setValue(copy);
        if (copy != 0) copy->unref();
    }

    {
        Basic::Pair* copy = 0;
        if (org.pntr != 0) copy = org.pntr->clone();
        setSymbolPair(copy);
        if (copy != 0) copy->unref();
    }
}
开发者ID:azcbuell,项目名称:OpenEaagles,代码行数:41,代码来源:SymbolLoader.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ basic::Pair类代码示例发布时间:2022-05-31
下一篇:
C++ baserenderer::Pointer类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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