本文整理汇总了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;
}
示例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");*/
}
示例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;
}
示例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;
}
示例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;
}
示例6:
QString
StoreLookup::lookupById(Id store_id)
{
Store loc;
if (store_id != INVALID_ID && _quasar->db()->lookup(store_id, loc))
return loc.name();
return "";
}
示例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);
}
}
示例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;
}
示例9: resize
void Storage::resize(const Store &other )
{
setCapacity( other.capacity() );
for( auto& goodType : good::all() )
{
setCapacity( goodType, other.capacity( goodType ) );
}
}
示例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);
}
示例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...);
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}