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


C++ Store类代码示例

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


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

示例1: main

int main()
{
  std::ifstream movie_data("data4movies.txt");
  std::ifstream customer_data("data4customers.txt");
  std::ifstream action_data("data4commands.txt");

  if(!movie_data) {
    std::cout << "data4movies.txt could not be opened\n";
    return 1;
  }

  if(!customer_data) {
    std::cout << "data4customers.txt could not be opened\n";
    return 1;
  }

  if(!action_data) {
    std::cout << "data4commands.txt could not be opened\n";
    return 1;
  }

  Store store;

  store.AddMovies(movie_data);
  store.AddCustomers(customer_data);
  store.ProcessActions(action_data);

  return 0;
}
开发者ID:rLadia,项目名称:Movie,代码行数:29,代码来源:main.cpp

示例2: main

int main()
{
	Store s;
	std::set<std::string> vstring;
	vstring.insert(".");
	vstring.insert("e:/sample");
	int count = 0;
	value v1;
	auto viter = vstring.begin();
	v1.push_back(viter);
	s.getMap()["venk2.txt"] = v1;
	value v2;
	v1.push_back(viter++);
	s.getMap()["venk1.txt"] = v2;
	std::vector<std::map<key, value>::iterator> mapiters;
	std::vector<std::map<key, value>::iterator> mapitersmatch;
	auto miter = s.getMap().begin();	
	mapiters.push_back(miter);
	mapiters.push_back(miter++);
	std::vector<std::string> patts;
	patts.push_back("ven");
	TextSearch Tsearch(s);
	mapitersmatch = Tsearch.getFiles(patts, mapiters);
	for (unsigned int i = 0; i < mapitersmatch.size(); i++)
	{
		for (auto liter = mapitersmatch[i]->second.begin(); liter != mapitersmatch[i]->second.end(); liter++)
		{
			std::cout << "\n" << FileSystem::Path::fileSpec(**liter, mapitersmatch[i]->first) << "\n";
		}
	}
	/*Tsearch.searchText(mapiters, "simple");*/
}
开发者ID:VenkatCheedella,项目名称:File-Catalogue,代码行数:32,代码来源:TextSearch.cpp

示例3: strcpy

Store Store::operator= (const Store & rhs)
{
	if(this == &rhs)
	{
		return *this;
	}
	delete[] _storeName;
	_storeName = NULL;
	delete[] _showcase;
	_showcase = NULL;

	if (rhs._storeName != NULL)
	{
		_storeName = new char[strlen(rhs.getStoreName()) + 1];
		strcpy(_storeName, rhs.getStoreName());
	}

	_productCount = rhs.getProductCount();
	
	_showcase = new Product[_productCount];
	for(int i = 0; i < _productCount; i++)
	{
		_showcase[i] = rhs._showcase[i];
	}
	
	return *this;
}
开发者ID:Mmonya,项目名称:Lena_folder,代码行数:27,代码来源:Store.cpp

示例4: REQUIRE

Store* City::robStore() {
	REQUIRE(properlyInitialized(), "Object 'City' was not properly properlyInitializedialized when calling robStore()");

	bool success = false;
	Store* ptr;
	int loops = 0;

	while (!success) {
		std::list<Store>::iterator it = stores.begin();
		int randomInt = rand()% stores.size();
		for (int i = 0; i < randomInt; i++) {
			it++;
		}

		ptr = &(*it);
		if (ptr->getState() == normal) {
			success = true;
		}
		if (loops == 100){
			return NULL;
		}
		loops++;
	}

	ptr->setState(beingrobbed);

	ENSURE(ptr->getState() == beingrobbed, "robStore() did not cause a robbery.");

	return ptr;
}
开发者ID:KrisTo-Corp,项目名称:ESS,代码行数:30,代码来源:City.cpp

示例5: internal_run

 virtual std::unique_ptr<Program> internal_run(Store& store)
 {
   store.declare(var, domain);
   std::unique_ptr<Program> residual = program->internal_run(store);
   store.unstack(var);
   return residual;
 }
开发者ID:ptal,项目名称:ntcc,代码行数:7,代码来源:ntcc.hpp

示例6:

QString
StoreLookup::lookupById(Id store_id)
{
    Store loc;
    if (store_id != INVALID_ID && _quasar->db()->lookup(store_id, loc))
	return loc.name();
    return "";
}
开发者ID:cwarden,项目名称:quasar,代码行数:8,代码来源:store_lookup.cpp

示例7: assert

void StoresManagementSystem::getAllStores(StoreIndex const &index, std::vector<Store::RefT> &stores) const {
	assert(index.isHardpoint());
	Store *store = index.valid() ? m_Hardpoints.at(index.hardpoint())->getStore() : 0;
	if (store) {
		stores.push_back(store);
		if(store->asRack()) store->asRack()->getChildren(stores, true);
	}
}
开发者ID:nsmoooose,项目名称:csp,代码行数:8,代码来源:StoresManagementSystem.cpp

示例8: mkdir

Store* Store::open(const std::string &path){
	if(!file_exists(path)){
		mkdir(path.c_str(), 0744);
	}
	Store *ret = new Store();
	ret->_path = path;
	ret->load_file_seqs();
	return ret;
}
开发者ID:ideawu,项目名称:sdb,代码行数:9,代码来源:store.cpp

示例9: resize

void Storage::resize(const Store &other )
{
  setCapacity( other.capacity() );

  for( auto& goodType : good::all() )
  {
    setCapacity( goodType, other.capacity( goodType ) );
  }
}
开发者ID:dalerank,项目名称:caesaria-game,代码行数:9,代码来源:storage.cpp

示例10: getCurrentSelection

	DataSnapshot::Ptr getCurrentSelection()
	{
		int row = list.getSelectedRow();
		Store* s = Store::getInstance();

		if (!s || row < 0 || row > s->size()) return nullptr;

		return s->get(row);
	}
开发者ID:SonicZentropy,项目名称:ZenAutoTrim,代码行数:9,代码来源:buffer_visualiser.cpp

示例11: operator

	Store<Args...> operator()(const Args&...  args)
	{
		auto helper = [](auto... param) {
			Store<decltype(param)...> stream;
			using List = int[];
			(void)List{ 0, ((void)(stream.add(param)), 0) ... };
			return stream;
		};
		return helper(args...);
	}
开发者ID:CCJY,项目名称:coliru,代码行数:10,代码来源:main.cpp

示例12: parseError

void InventoryStoreQueryResponse::parseNormalResponse() {
    parseError();
    if (responseParser->hasName("store_list")) {
        QList<Parser *> listParser = responseParser->getListObjectParser("store_list");
        Parser *parser;
        foreach (parser, listParser) {
            Store tmp;
            tmp.setParser(parser);
            tmp.parseResponse();
            storeList.append(tmp);
        }
开发者ID:sd44,项目名称:TaobaoCppQtSDK,代码行数:11,代码来源:InventoryStoreQueryResponse.cpp

示例13: calc

void calc(Store& s, char* store_fname, int order){
	s.open(store_fname);
	if (!s.is_init()){
		wcerr << "Store is not initialized, initializing..." << endl;
		s.init();
		wcerr << "Store initialized!" << endl;
	}

	double H = s.entropy(order);

	wcout << H << endl;

}
开发者ID:Mandrathax,项目名称:Entropy,代码行数:13,代码来源:entropy.cpp

示例14: getProductWithUserChoise

void MenuSupport::addProductToAllStores()
{
	Product* localProduct = getProductWithUserChoise();
	const char* const productName = localProduct->getProductName();

	StoreCountType storeCount = _shoppingStores->getStoreCount();
	for (StoreCountType i = 0; i < storeCount; i++)
	{
		Store* store = _shoppingStores->getStoreAtIndex(i);
		store->addProduct(new Product(*localProduct));
	}
	delete localProduct;
}
开发者ID:Mmonya,项目名称:Monya_folder,代码行数:13,代码来源:MenuSupport.cpp

示例15: switch

void
RecurringMaster::setGltx(Id gltx_id)
{
    Gltx gltx;
    _quasar->db()->lookup(gltx_id, gltx);

    Store store;
    _quasar->db()->lookup(gltx.storeId(), store);

    _type->setText(gltx.dataTypeName());
    _number->setText(gltx.number());
    _store->setText(store.name());
    _date->setText(DateValcon().format(gltx.postDate()));

    Card card;
    _quasar->db()->lookup(gltx.cardId(), card);
    _card->setText(card.nameFL());

    if (_curr.cardGroup() == INVALID_ID) {
	_cardLabel->setChecked(true);
    } else {
        _groupLabel->setChecked(true);
    }

    if (_lastPost->getDate().isNull()) {
	_lastPost->setDate(gltx.postDate());
	slotRefresh();
    }

    switch (gltx.dataType()) {
    case DataObject::INVOICE:
	_cardLabel->setText(tr("Customer:"));
	_groupLabel->setEnabled(true);
	_group->setEnabled(true);
	_groupLookup->type->setCurrentItem(Group::typeName(Group::CUSTOMER));
	break;
    case DataObject::RECEIVE:
	_cardLabel->setText(tr("Vendor:"));
	_groupLabel->setEnabled(true);
	_group->setEnabled(true);
	_groupLookup->type->setCurrentItem(Group::typeName(Group::VENDOR));
	break;
    default:
	_cardLabel->setText(tr("Card:"));
	_groupLabel->setEnabled(false);
	_group->setEnabled(false);
    }

    _curr.setGltxId(gltx_id);
}
开发者ID:cwarden,项目名称:quasar,代码行数:50,代码来源:recurring_master.cpp


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