49 #ifndef Xyce_N_DEV_Algorithm_h
50 #define Xyce_N_DEV_Algorithm_h
56 #include <N_PDS_fwd.h>
80 template <
class D,
class Op>
83 d.forEachInstance(op);
101 template <
class D,
class Op>
124 const std::string &
getName(
const C *c);
271 (*it_)++ =
getName(device_instance);
307 MapOp(std::map<std::string, C *> &map)
324 map_[
getName(device_instance)] =
static_cast<C *
>(device_instance);
328 std::map<std::string, C *> &
map_;
346 template <
class D,
class Out>
367 template <
class D,
class Out>
388 template<
class D,
class Out>
409 template<
class D,
class X>
442 #endif // Xyce_N_DEV_Algorithm_h
std::map< std::string, C * > & map_
void forEachModel(const D &d, Op op)
Call forEachModel on object d, passing operator op.
operator to populate a map from device instance name to device instance pointer
Pure virtual class to augment a linear system.
void forEachInstance(const D &d, Op op)
Call forEachInstance on object d, passing operator op.
void getDeviceInstances(const D &d, Out it)
Calls forEachInstance() on d which iterates through all the instances copies them to the output itera...
Operator to populate a container of strings with the names of the device instances.
Operator to populate a container via an output iterator with device instances.
DeviceInstanceNameOp(Out it)
Copies output iterator to it_.
void getDeviceModels(const D &d, Out it)
Calls forEachModel() on d which iterates through all the models copies them to the output iterator...
const std::string & getName(const C *c)
Returns the name of the specified object.
virtual bool operator()(DeviceModel *model)
Copies model pointer through output iterator.
Operator to populate a container via an output iterator with device models.
bool devicesConverged(Parallel::Machine comm, const InstanceVector &extern_devices)
virtual bool operator()(DeviceInstance *device_instance)
DeviceInstanceOutIteratorOp(Out it)
Copies output iterator into operator.
void mapDeviceInstances(const D &d, std::map< std::string, X * > &map)
Calls forEachInstance() on d which iterates through all the instances and inserts the device instance...
DeviceModelOutIteratorOp(Out it)
Copies output iterator into operator.
virtual bool operator()(DeviceInstance *instance)
Copies instance pointer through output iterator.
std::vector< DeviceInstance * > InstanceVector
virtual bool operator()(DeviceInstance *device_instance)
Write the result of getName(instance) to the output iterator.
void getDeviceInstanceNames(const D &d, Out it)
Calls forEachInstance() on d which iterates through all the instance and copies the name to the outpu...
MapOp(std::map< std::string, C * > &map)
Destination map reference into the operator.