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


C++ Content类代码示例

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


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

示例1: if

ContentPtr Panel::getContent( const std::string contentID, int& index )
{
	for( TabItr i = tabList_.begin(); i != tabList_.end(); ++i )
	{
		Content* content = (*i)->getContent().getObject();
		if ( !content )
			continue;
		if ( contentID.compare( content->getContentID() ) == 0 )
		{
			if ( index <= 0 )
				return content;
			else
				index--;
		}
		else if ( content->getContentID() == ContentContainer::contentID &&
			((ContentContainer*)content)->contains( contentID ) )
		{
			content = ((ContentContainer*)content)->getContent( contentID, index ).getObject();
			if ( content )
				return content;
			// index already decremented by ContentContainer::getContent
		}
	}

	return 0;
}
开发者ID:siredblood,项目名称:tree-bumpkin-project,代码行数:26,代码来源:panel.cpp

示例2: createErrorContent

ContentPtr ContentFactory::createErrorContent(const Content& content)
{
    const auto& uri = content.getUri();
    const auto& size = content.getDimensions();

    return std::make_unique<ErrorContent>(uri, size);
}
开发者ID:BlueBrain,项目名称:Tide,代码行数:7,代码来源:ContentFactory.cpp

示例3: main

int main()
{
#if 1
    Content * cont;     /// < 得到锦囊
    
    cont = new Content(new Backdoor());
    cont->operate();    /// < 开后门
    delete cont;

    cont = new Content(new Greelight());
    cont->operate();    /// < 开绿灯
    delete cont;

    cont = new Content(new BlockEnemy());
    cont->operate();    /// < 段后 
    delete cont;
#endif

    cout << "\n------------" << endl;

#if 1
    /// < 模板方式
    ContentT<Backdoor> contBck;
    contBck.operate();
    
    ContentT<Greelight> contGrl;
    contGrl.operate();
    
    ContentT<BlockEnemy> contBlk;
    contBlk.operate();
#endif

    return 0;
}
开发者ID:FanChael,项目名称:cplusplus-version-to-achieve-24-design-patterns-and-six-design-principles-,代码行数:34,代码来源:main.cpp

示例4: create

	//method that's called when algorithm is registered                                                                                                                                                        
	//list input and output datasets here                                                                                                                                                                      
	static Algorithm* create() 
	{
		Content* algo = new Content();
		algo->addInputDataset("imagesIn");
		algo->addOutputDataset("imagesOut");
		return algo;
	}
开发者ID:Andy-Amoy,项目名称:mr4c,代码行数:9,代码来源:content.cpp

示例5: QPixmap

QPixmap
AtticaManager::iconForResolver( const Content& resolver )
{
    if ( !m_resolverStates[ resolver.id() ].pixmap )
        return QPixmap();

    return *m_resolverStates.value( resolver.id() ).pixmap;
}
开发者ID:Pritoj,项目名称:tomahawk,代码行数:8,代码来源:AtticaManager.cpp

示例6: Clear

 void Clear()
 {
   for (Content::iterator it = content_.begin();
        it != content_.end(); ++it)
   {
     delete *it;
   }
 }
开发者ID:nguyentantrung012,项目名称:orthanc,代码行数:8,代码来源:MongooseServer.cpp

示例7: while

	void ChannelPlayerAdapter::createPlayer() {
		Player* childPlayer = NULL;
		CompositeExecutionObject* cpExObj;
		ExecutionObject* childObj;
		vector<ExecutionObject*>* objects;
		map<string, Player*>* objectMap;
		Content* content;
		string mrlPlayer;
		string selectedObject = "";

		cpExObj = (CompositeExecutionObject*)object;
		objectMap = new map<string, Player*>; 
		objects = cpExObj->getExecutionObjects();

		if (objects != NULL && cpExObj->getDescriptor() != NULL) {
			vector<ExecutionObject*>::iterator i;
			i = objects->begin();
			while (i != objects->end()) {
				childObj = *i;
				if (childObj != NULL && childObj->getDataObject() != NULL &&
						childObj->getDataObject()->getDataEntity() != NULL &&
						((NodeEntity*)(childObj->getDataObject()->
							getDataEntity()))->getContent() != NULL) {

					content = ((NodeEntity*)(childObj->getDataObject()->
						    getDataEntity()))->getContent();

					if (content->instanceOf("ReferenceContent")) {
						mrlPlayer = ((ReferenceContent*)content)->
							    getCompleteReferenceUrl();

						childPlayer = new AVPlayer(mrlPlayer, hasVisual);
						(*objectMap)[childObj->
						             getDataObject()->getId()] = childPlayer;
					}
				}
				++i;
			}

			//cout << "ChannelPlayerAdapter::createPlayer objMap->size = ";
			//cout << objectMap->size() << endl;
			selectedObject = cpExObj->getDescriptor()->
				    getParameterValue("selectedObject");
		}

		if (objects != NULL) {
			delete objects;
			objects = NULL;
		}

		player = new ChannelPlayer(objectMap);
		if (selectedObject != "") {
			childPlayer = ((ChannelPlayer*)player)->getPlayer(selectedObject);
			((ChannelPlayer*)player)->select(childPlayer);
		}

		FormatterPlayerAdapter::createPlayer();
	}
开发者ID:lince,项目名称:ginga-wac,代码行数:58,代码来源:ChannelPlayerAdapter.cpp

示例8: Remove

 void Remove(const std::string& filename)
 {
   Content::iterator it = Find(filename);
   if (it != content_.end())
   {
     delete *it;
     content_.erase(it);
   }
 }
开发者ID:nguyentantrung012,项目名称:orthanc,代码行数:9,代码来源:MongooseServer.cpp

示例9: tabContains

bool Panel::tabContains( TabPtr t, ContentPtr content )
{
	Content* tcontent = t->getContent().getObject();
	if ( !tcontent )
		return 0;
	
	return tcontent == content ||
			( tcontent->getContentID() == ContentContainer::contentID &&
			((ContentContainer*)tcontent)->contains( content ) );
}
开发者ID:siredblood,项目名称:tree-bumpkin-project,代码行数:10,代码来源:panel.cpp

示例10:

AtticaManager::ResolverState
AtticaManager::resolverState ( const Content& resolver ) const
{
    if ( !m_resolverStates.contains( resolver.id() ) )
    {
        return AtticaManager::Uninstalled;
    }

    return m_resolverStates[ resolver.id() ].state;
}
开发者ID:Pritoj,项目名称:tomahawk,代码行数:10,代码来源:AtticaManager.cpp

示例11: switch

std::unique_ptr<DataSource> DataSourceFactory::create(const Content& content)
{
    switch (content.getType())
    {
#if TIDE_ENABLE_MOVIE_SUPPORT
    case ContentType::movie:
        return std::make_unique<MovieUpdater>(content.getUri());
#endif

    case ContentType::pixel_stream:
#if TIDE_ENABLE_WEBBROWSER_SUPPORT
    case ContentType::webbrowser:
#endif
        return std::make_unique<PixelStreamUpdater>(content.getUri());
    case ContentType::svg:
        return std::make_unique<SVGTiler>(content.getUri(),
                                          content.getMaxDimensions());
    case ContentType::image:
        return std::make_unique<ImageSource>(content.getUri());

#if TIDE_ENABLE_PDF_SUPPORT
    case ContentType::pdf:
        return std::make_unique<PDFTiler>(content.getUri(),
                                          content.getMaxDimensions());
#endif

#if TIDE_USE_TIFF
    case ContentType::image_pyramid:
        return std::make_unique<ImagePyramidDataSource>(content.getUri());
#endif
    default:
        throw std::logic_error("No data source for this content type");
    }
}
开发者ID:BlueBrain,项目名称:Tide,代码行数:34,代码来源:DataSourceFactory.cpp

示例12: find

void Host::delete_content(int cid){
	std::vector<int>::iterator it;
	it = find(cids_.begin(), cids_.end(), cid);
	if(it!=cids_.begin())
		cids_.erase(it);

	/* Delete the content file */
	Content c;
	string filename = c.get_content_name_in_host(id_,cid);
	remove(filename.c_str());
}
开发者ID:telescreen,项目名称:commnet2-project3,代码行数:11,代码来源:host.cpp

示例13: checkNode

// 0 -> not valid; 1 -> valid
int Xmlvalidator::checkNode(Item* node) {
	Tag* tagNode = dynamic_cast<Tag *>(node);

	if (tagNode) {
		string name = tagNode->getName();
		string transfo = "";

		vector<Item *> children = tagNode->getChildren();
		for(vector<Item *>::iterator itCh = children.begin(); itCh != children.end(); itCh++) {
			Element* elNode = dynamic_cast<Element *>(*itCh);
			if (elNode)
			{
				transfo += "<"+elNode->getName()+">";
			}
			else
			{
				Content* ctNode = dynamic_cast<Content *>(*itCh);
				if (ctNode)
				{
					transfo += ctNode->textContent();
				}

			}

			// Recursive call for each children
			if (checkNode((*itCh)) == 0)
			{
				// if it is not valid
				return 0;
			}
		}

		std::map<string,string>::iterator itRegex = mapRegex.find(name);

		if (itRegex == mapRegex.end())
		{
			std::map<string,string>::iterator itType = mapType.find(name);
		 	itRegex = mapRegex.find(itType->second);
			
			if (itRegex == mapRegex.end())
			{
		 		cerr << "XSD not exhaustive for this xml. Missing regex for the type " << itType->second << endl;
		 	}
		}

		string regex = itRegex->second;

		// cout << "DO THE CHECK " << regex << " on " << transfo << " for the node " << name << endl;
		std::regex rx(regex);
		return regex_match(transfo.begin(), transfo.end(), rx);
	}

	return 1;
}
开发者ID:pmdartus,项目名称:XML-processor,代码行数:55,代码来源:xmlvalidator.cpp

示例14: Find

    Content::iterator Find(const std::string& filename)
    {
      for (Content::iterator it = content_.begin();
           it != content_.end(); ++it)
      {
        if ((*it)->GetFilename() == filename)
        {
          return it;
        }
      }

      return content_.end();
    }
开发者ID:nguyentantrung012,项目名称:orthanc,代码行数:13,代码来源:MongooseServer.cpp

示例15: showTab

void Panel::showTab( const std::string contentID, bool show )
{
	for( TabItr i = tabList_.begin(); i != tabList_.end(); ++i )
	{
		if ( tabContains( *i, contentID ) )
		{
			showTab( *i, show );
			Content* tcontent = (*i)->getContent().getObject();
			if ( tcontent && tcontent->getContentID() == ContentContainer::contentID )
				((ContentContainer*)tcontent)->currentContent( contentID );
		}
	}
}
开发者ID:siredblood,项目名称:tree-bumpkin-project,代码行数:13,代码来源:panel.cpp


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