void testComponentList() { ComponentList a; a.push_back(Component(MS_nanoelectrospray, 1)); a.push_back(Component(MS_quadrupole_ion_trap, 2)); a.push_back(Component(MS_electron_multiplier, 3)); testObject(a); }
void testComponentList() { if (os_) *os_ << "testComponentList()\n"; ComponentList componentList; componentList.push_back(Component(ComponentType_Source, 1)); componentList.push_back(Component(ComponentType_Analyzer, 2)); componentList.push_back(Component(ComponentType_Detector, 3)); componentList.source(0).paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg"))); componentList.analyzer(0).paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg"))); componentList.detector(0).paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg"))); MSData msd; msd.paramGroupPtrs.push_back(ParamGroupPtr(new ParamGroup("pg"))); msd.paramGroupPtrs.back()->userParams.push_back(UserParam("user")); References::resolve(componentList, msd); unit_assert(!componentList.source(0).paramGroupPtrs[0]->userParams.empty()); unit_assert(!componentList.analyzer(0).paramGroupPtrs[0]->userParams.empty()); unit_assert(!componentList.detector(0).paramGroupPtrs[0]->userParams.empty()); }
void EntityManager::GetAllComponentsFor(const Entity *entity, ComponentList &list) const { ASSERT(entity != NULL); if (!IsValid(entity)) return; for (ComponentStore::const_iterator i = m_components.begin(); i != m_components.end(); ++i) { const EntityComponentsMap &entitiesWithComponent = i->second; EntityComponentsMap::const_iterator j = entitiesWithComponent.find(entity); if (j != entitiesWithComponent.end()) list.push_back(j->second); } }
LogComponent::LogComponent (char const * name) : m_levels (0), m_name (name) { //EnvVarCheck (name); ComponentList *components = GetComponentList (); for (ComponentListI i = components->begin (); i != components->end (); i++) { if (i->first == name) { std::cerr << "Log component \""<<name<<"\" has already been registered once." << std::endl; } } components->push_back (std::make_pair (name, this)); }