#include <gadget/Type/BaseTypeFactory.h>
Public Member Functions | |
| void | registerNetDevice (BaseTypeConstructorBase *constructor) |
| bool | recognizeNetDevice (std::string base_type) |
| Queries if the factory knows about the given device. | |
| Input * | loadNetDevice (std::string base_type) |
| Loads the specified device. | |
Definition at line 91 of file BaseTypeFactory.h.
| void gadget::BaseTypeFactory::registerNetDevice | ( | BaseTypeConstructorBase * | constructor | ) |
Definition at line 156 of file BaseTypeFactory.cpp.
00157 { 00158 vprASSERT(constructor != NULL); 00159 mConstructors.push_back(constructor); // Add the constructor to the list 00160 }
| bool gadget::BaseTypeFactory::recognizeNetDevice | ( | std::string | base_type | ) |
Queries if the factory knows about the given device.
| base_type | The base type of the config element element we are requesting about knowledge to create. |
Definition at line 164 of file BaseTypeFactory.cpp.
Referenced by loadNetDevice().
| Input * gadget::BaseTypeFactory::loadNetDevice | ( | std::string | base_type | ) |
Loads the specified device.
| base_type | The base type of the specification of the device to load. |
Definition at line 172 of file BaseTypeFactory.cpp.
References gadget::BaseTypeConstructorBase::createNetDevice(), gadgetDBG_RIM(), and recognizeNetDevice().
00173 { 00174 vprASSERT(recognizeNetDevice(base_type)); 00175 00176 int index = findConstructor(base_type); 00177 00178 Input* new_dev; 00179 BaseTypeConstructorBase* constructor = mConstructors[index]; 00180 00181 new_dev = constructor->createNetDevice(base_type); 00182 if(new_dev!=NULL) 00183 { 00184 vprDEBUG(gadgetDBG_RIM,vprDBG_VERB_LVL) 00185 << "[NetDevice Factory] Found the BaseType\n"<< vprDEBUG_FLUSH; 00186 } 00187 return new_dev; 00188 }
1.5.1