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

C++ VariantList类代码示例

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

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



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

示例1: main

	virtual void main()
	{
		//init
		QString psname = getString("psname");
		if (psname=="") psname = getInfile("in");

		//load
		VariantList variants;
		variants.load(getInfile("in"));

		//annotate
		bool test = getFlag("test");
		QString mode = getEnum("mode");
		if(mode=="germline")
		{
			NGSD(test).annotate(variants, psname);
		}
		else if(mode=="somatic")
		{
			NGSD(test).annotateSomatic(variants, psname);
		}

		//store
		variants.store(getOutfile("out"));
	}
开发者ID:imgag,项目名称:ngs-bits,代码行数:25,代码来源:main.cpp


示例2: load

void RandomFire::load(const VariantMap& stream)
{
  VariantList vl = stream.get( lc_population ).toList();
  _d->minPopulation = vl.get( 0, 0 ).toInt();
  _d->maxPopulation = vl.get( 1, 999999 ).toInt();
  _d->strong = stream.get( lc_strong, 10 );
}
开发者ID:KSLcom,项目名称:caesaria-game,代码行数:7,代码来源:random_fire.cpp


示例3: OnPressToggle

void MoveButtonState::OnPressToggle(bool bDown, boost::signal<void (VariantList*)> *pCustomSignal)
{
	VariantList v;

	if (bDown)
	{

	if (!m_bIsDown)
	{
		m_bIsDown = true;

		v.Get(0).Set(uint32(m_keyType));
		v.Get(1).Set(uint32(VIRTUAL_KEY_PRESS)); 
		if (pCustomSignal)
		{
			(*pCustomSignal)(&v);
		} else
		{
			GetBaseApp()->m_sig_arcade_input(&v);
		}	
	}

	m_releaseTimer = rt_max(GetTick(TIMER_SYSTEM), m_releaseTimer);
	m_releaseTimer += 1000*60;
	} else
	{
		ReleaseIfNeeded(pCustomSignal);
	}
}
开发者ID:Zaxuhe,项目名称:ludum-dare-24,代码行数:29,代码来源:ArcadeInputComponent.cpp


示例4: load

 virtual void load(const VariantList& stream)
 {
   for (const auto& item : stream) {
     VariantList vl = item.toList();
     (*this)[ vl.get(0) ] = vl.get(1);
   }
 }
开发者ID:dalerank,项目名称:caesaria-game,代码行数:7,代码来源:serialized_map.hpp


示例5: load

void Base::load(const VariantList& stream)
{
  type = (Type)stream.get( ftype ).toInt();
  date = stream.get( fdate ).toDateTime();
  objectName = stream.get( fname ).toString();
  message = stream.get( fmessage ).toString();
  location = stream.get( flocation ).toPoint();
}
开发者ID:Ecordonnier,项目名称:caesaria-game,代码行数:8,代码来源:notification.cpp


示例6: load

 void load( const VariantList& stream )
 {
   for( unsigned int i=0; i < stream.size(); i+=2 )
   {
     Service::Type type = Service::Type( stream.get( i ).toInt() );
     at( type )->set( stream.get( i+1 ).toFloat() ); //serviceValue
   }
 }
开发者ID:dalerank,项目名称:caesaria-game,代码行数:8,代码来源:house.cpp


示例7: removeColumnIfPresent

bool NGSD::removeColumnIfPresent(VariantList& variants, QString name, bool exact_name_match)
{
	int index = variants.annotationIndexByName(name, exact_name_match, false);
	if (index==-1) return false;

	variants.removeAnnotation(index);
	return true;
}
开发者ID:mdozmorov,项目名称:ngs-bits,代码行数:8,代码来源:NGSD.cpp


示例8: onDeserialize

void Addressable::onDeserialize(VariantList& variants) {
	if(variants.hasKey("class")) {
		addClasses(variants.get("class").asStringList());
	}
	if(variants.hasKey("id")) {
		setId(variants.get("id"));
	}
}
开发者ID:underdoeg,项目名称:ofxBoxModel,代码行数:8,代码来源:Addressable.cpp


示例9: load

void RandomDamage::load(const VariantMap& stream)
{
  VariantList vl = stream.get( lc_population ).toList();
  _d->minPopulation = vl.get( 0, 0 ).toInt();
  _d->maxPopulation = vl.get( 1, 999999 ).toInt();
  VARIANT_LOAD_ANY_D( _d, strong, stream );
  VARIANT_LOAD_ANY_D( _d, priority, stream );

}
开发者ID:mdl8bit,项目名称:caesaria-game,代码行数:9,代码来源:random_damage.cpp


示例10: save

VariantList GoodStock::save() const
{
  VariantList stream;
  stream.push_back( (int)_type );
  stream.push_back( _maxQty );
  stream.push_back( _currentQty );

  return stream;
}
开发者ID:hellium,项目名称:opencaesar3,代码行数:9,代码来源:oc3_good.cpp


示例11: save

  virtual VariantList save() const
  {
    VariantList ret;
    for (const auto& item : *this) {
      ret.push_back(VariantList(item.first, item.second));
    }

    return ret;
  }
开发者ID:dalerank,项目名称:caesaria-game,代码行数:9,代码来源:serialized_map.hpp


示例12: load

void GoodStock::load( const VariantList& stream )
{
  if( stream.size() < 3 )
    return;

  VariantList::const_iterator it=stream.begin();
  _type = (Good::Type)(*it).toInt(); it++;
  _maxQty = (*it).toInt(); it++;
  _currentQty = math::clamp( (*it).toInt(), 0, _maxQty );
}
开发者ID:hellium,项目名称:opencaesar3,代码行数:10,代码来源:oc3_good.cpp


示例13: save

  VariantList save() const
  {
     VariantList ret;
     for( auto& mapItem : *this )
     {
       ret.push_back( Variant( (int)mapItem.first ) );
       ret.push_back( Variant( mapItem.second->value() ) );
     }

     return ret;
  }
开发者ID:dalerank,项目名称:caesaria-game,代码行数:11,代码来源:house.cpp


示例14: addColumn

int NGSD::addColumn(VariantList& variants, QString name, QString description)
{
	variants.annotations().append(VariantAnnotationHeader(name));
	for (int i=0; i<variants.count(); ++i)
	{
		variants[i].annotations().append("");
	}

	variants.annotationDescriptions().append(VariantAnnotationDescription(name, description));

	return variants.annotations().count() - 1;
}
开发者ID:mdozmorov,项目名称:ngs-bits,代码行数:12,代码来源:NGSD.cpp


示例15: switch

void ArcadeInputComponent::ActivateBinding(ArcadeKeyBind *pBind, bool bDown)
{
	//special handling for directional keys, so they work in tandem with the trackball or whatever else also does directions

	bool bWasDirectionalKey = true;

	switch (pBind->m_outputkeycode)
	{
		case VIRTUAL_KEY_DIR_LEFT:  m_buttons[MOVE_BUTTON_DIR_LEFT].OnPressToggle(bDown, m_customSignal);  break;
		case VIRTUAL_KEY_DIR_RIGHT:  m_buttons[MOVE_BUTTON_DIR_RIGHT].OnPressToggle(bDown, m_customSignal);  break;
		case VIRTUAL_KEY_DIR_UP:  m_buttons[MOVE_BUTTON_DIR_UP].OnPressToggle(bDown, m_customSignal);  break;
		case VIRTUAL_KEY_DIR_DOWN:  m_buttons[MOVE_BUTTON_DIR_DOWN].OnPressToggle(bDown, m_customSignal); break;
			
		default:

			bWasDirectionalKey = false;
			break;
	}

	if (bWasDirectionalKey) 
	{
		//avoid sending it twice, we already would above
		return;
	}

	//for other keys, just send it through the arcade signal:
	VariantList v;
	v.Get(0).Set(pBind->m_outputkeycode);
	v.Get(1).Set(uint32(bDown)); 

	if (m_customSignal)
	{
		(*m_customSignal)(&v);
	} else
	{
		GetBaseApp()->m_sig_arcade_input(&v);
	}

	if (bDown)
	{
		//send as normal key, only on the keydown
		VariantList v2;
		v2.Get(0).Set((float)MESSAGE_TYPE_GUI_CHAR);
		v2.Get(1).Set(0,0);
		v2.Get(2).Set(uint32(pBind->m_outputkeycode));
		GetBaseApp()->m_sig_input(&v2);
	}
	if (pBind->m_bOutputAsNormalKeyToo)
	{
		//also send as regular global key
		GetBaseApp()->m_sig_raw_keyboard(&v);
	}
}
开发者ID:Zaxuhe,项目名称:ludum-dare-24,代码行数:53,代码来源:ArcadeInputComponent.cpp


示例16: self

void JSAPIImpl::FireJSEvent( const std::string& eventName, const VariantMap &members, const VariantList &arguments )
{
    if (!m_valid)   // When invalidated, do nothing more
        return;

    {
        JSAPIImplPtr self(shared_from_this());
        boost::recursive_mutex::scoped_lock _l(m_proxyMutex);
        ProxyList::iterator proxyIt = m_proxies.begin();
        while (proxyIt != m_proxies.end()) {
            JSAPIImplPtr proxy(proxyIt->lock());
            if (!proxy) {
                // Since you can't use a shared_ptr in a destructor, there
                // is no way for the proxy object to let us know when it goes
                // away; thus when we find them, we remove them for efficiency
                proxyIt = m_proxies.erase(proxyIt);
                continue;
            }

            VariantList newArgs = proxyProcessList(arguments, self, proxy);
            VariantMap newMap = proxyProcessMap(members, self, proxy);

            proxy->FireJSEvent(eventName, newMap, newArgs);
            proxyIt++;
        }
    }

    VariantList args;
    args.push_back(CreateEvent(shared_from_this(), eventName, members, arguments));

    {
        boost::recursive_mutex::scoped_lock _l(m_eventMutex);
        EventContextMap::iterator it(m_eventMap.begin());
        while (it != m_eventMap.end()) {
            std::pair<EventMultiMap::iterator, EventMultiMap::iterator> range = it->second.equal_range(eventName);
            for (EventMultiMap::const_iterator eventIt = range.first; eventIt != range.second; eventIt++) {
                eventIt->second->InvokeAsync("", args);
            }
            ++it;
        }
    }

    // Some events are registered as a jsapi object with a method of the same name as the event
    {
        boost::recursive_mutex::scoped_lock _l(m_eventMutex);
        EventIfaceContextMap::iterator it(m_evtIfaces.begin());
        while (it != m_evtIfaces.end()) {
            for (EventIFaceMap::const_iterator ifaceIt = it->second.begin(); ifaceIt != it->second.end(); ifaceIt++) {
                ifaceIt->second->InvokeAsync(eventName, args);
            }
        }
    }
}
开发者ID:gotomypc,项目名称:AmbientLib,代码行数:53,代码来源:JSAPIImpl.cpp


示例17: save

void TileOverlay::save( VariantMap& stream ) const
{
  VariantList config;
  config.push_back( (int)_d->overlayType );
  config.push_back( Variant( MetaDataHolder::instance().getData( _d->overlayType ).getName() ) );
  config.push_back( getTile().getIJ() );

  stream[ "config" ] = config;
  stream[ "picture" ] = Variant( _d->picture.getName() );
  stream[ "pictureOffset" ] = _d->picture.getOffset();
  stream[ "size" ] = _d->size;
  stream[ "isDeleted" ] = _d->isDeleted;
  stream[ "name" ] = Variant( _d->name );
}
开发者ID:BlackFoks,项目名称:opencaesar3,代码行数:14,代码来源:tileoverlay.cpp


示例18: save

VariantMap Storage::save() const
{
  VariantMap stream = good::Store::save();

  stream[ "max" ] = _gsd->capacity;

  VariantList stockSave;
  for( auto& stockInfo : _gsd->stocks )
    stockSave.push_back( stockInfo->save() );

  stream[ "stock" ] = stockSave;

  return stream;
}
开发者ID:dalerank,项目名称:caesaria-game,代码行数:14,代码来源:storage.cpp


示例19: load

void Stock::load( const VariantList& stream )
{
  if( stream.empty())
    return;

  _type = stream.get( 0 ).toInt();
  if( _type >= good::goodCount.toInt() )
  {
    Logger::warning( "GoodStock: wrong type of good %d", _type );
    _type = good::none.toInt();
  }

  _capacity = (int)stream.get( 1 );
  _qty = math::clamp( (int)stream.get( 2 ), 0, _capacity );
}
开发者ID:KSLcom,项目名称:caesaria-game,代码行数:15,代码来源:good.cpp


示例20: load

void SimpleGoodStore::load( const VariantMap& stream )
{
    _goodStockList.clear();

    GoodStore::load( stream );
    _maxQty = (int)stream.get( "max" );

    VariantList stockSave = stream.get( "stock" ).toList();
    for( VariantList::iterator it=stockSave.begin(); it!=stockSave.end(); it++ )
    {
        GoodStock restored;
        restored.load( (*it).toList() );
        _goodStockList.push_back( restored );
    }
}
开发者ID:nickers,项目名称:opencaesar3,代码行数:15,代码来源:oc3_goodstore_simple.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ VariantMap类代码示例发布时间:2022-05-31
下一篇:
C++ VariantCallFile类代码示例发布时间: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