SimObjectPopulation Class Reference

Simple population of SimObjects. More...

#include <SimObjectPopulation.h>

Inheritance diagram for SimObjectPopulation:

Inheritance graph
[legend]
Collaboration diagram for SimObjectPopulation:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 SimObjectPopulation (SimNetwork &net, SimObjectFactory &objFactory, size_t n)
 SimObjectPopulation (SimNetwork &net, const SimObject::ID::Vector v)
 SimObjectPopulation (SimNetwork &net, vector< SimObject::ID::Packed > const &v)
SimObject::ID::Packed operator[] (int idx) const
virtual SimObject::ID getID (int idx) const
SimObjectobject (int idx) const
SimObject::ID operator() (int idx) const
size_t size () const
 Return the number objects in the population.
const vector
< SimObject::ID::Packed > & 
idVector () const
virtual ~SimObjectPopulation ()
SimNetworkgetNet () const
shared_ptr< SimObjectPopulationsubset (vector< size_t > const &subindices) const
 Return a new SimObjectPopulation which is a subset specified by the given set of indices.
shared_ptr< SimObjectPopulationlocalSubPopulation ()
vector< size_t > * localIndexes ()
bool setFieldScale (string const &fieldname, double scale)
virtual shared_ptr
< SimObjectPopulation
record (const SimObjectFactory &recFactory, const port_t src_port=0)
virtual shared_ptr
< SimObjectPopulation
record (const SimObjectFactory &recFactory, const string field)

Protected Member Functions

 SimObjectPopulation ()
 Invoked only by derived classes.
 SimObjectPopulation (SimNetwork &net)
 Invoked only by derived classes.
 SimObjectPopulation (const vector< SimObject::ID::Packed > &v)
virtual SimObjectPopulationnew_subset (vector< size_t > const &indices) const
 Return a new SpatialSimObjectPopulation which is a subset specified by the given set of indices.

Protected Attributes

SimObject::ID::Vector shr_ptr_vec
 This shared pointer is the owner of the id vector if generated in the constructor.
const vector
< SimObject::ID::Packed > * 
id_vec
 This is just a pointer to the array but has nothing to do with the ownership.
SimNetworknet
 The network to which this population belongs.

Friends

class WiringMethod
class OneToOneWiringMethod
class SimpleAllToAllWiringMethod
class DistributedSyncWiringMethod


Detailed Description

Simple population of SimObjects.

This is the simplest population class. It just holds an array of SimObjects, without any spatial coordinates or other identity attributes whatsoever. Individual SimObjects and their IDs can be retrieved by their population index number (integer value).

Definition at line 27 of file SimObjectPopulation.h.


Constructor & Destructor Documentation

SimObjectPopulation::SimObjectPopulation (  )  [inline, protected]

Invoked only by derived classes.

Definition at line 32 of file SimObjectPopulation.h.

Referenced by localSubPopulation(), new_subset(), and record().

SimObjectPopulation::SimObjectPopulation ( SimNetwork net  )  [inline, protected]

Invoked only by derived classes.

Definition at line 36 of file SimObjectPopulation.h.

SimObjectPopulation::SimObjectPopulation ( SimNetwork net,
SimObjectFactory objFactory,
size_t  n 
) [inline]

Definition at line 41 of file SimObjectPopulation.h.

References SimNetwork::add(), id_vec, and shr_ptr_vec.

Here is the call graph for this function:

SimObjectPopulation::SimObjectPopulation ( SimNetwork net,
const SimObject::ID::Vector  v 
) [inline]

Definition at line 48 of file SimObjectPopulation.h.

References id_vec, and shr_ptr_vec.

SimObjectPopulation::SimObjectPopulation ( SimNetwork net,
vector< SimObject::ID::Packed > const &  v 
) [inline]

Definition at line 55 of file SimObjectPopulation.h.

References id_vec, and shr_ptr_vec.

SimObjectPopulation::SimObjectPopulation ( const vector< SimObject::ID::Packed > &  v  )  [inline, protected]

Invoked internally from Wiring method. not exposed in python The vector pointed to by id_vec is not owned by the population when using this constructor.

Definition at line 71 of file SimObjectPopulation.h.

References id_vec.

virtual SimObjectPopulation::~SimObjectPopulation (  )  [inline, virtual]

Definition at line 102 of file SimObjectPopulation.h.


Member Function Documentation

SimObject::ID::Packed SimObjectPopulation::operator[] ( int  idx  )  const [inline]

Definition at line 77 of file SimObjectPopulation.h.

References id_vec.

virtual SimObject::ID SimObjectPopulation::getID ( int  idx  )  const [inline, virtual]

SimObject* SimObjectPopulation::object ( int  idx  )  const [inline]

Definition at line 85 of file SimObjectPopulation.h.

References id_vec, net, and SimNetwork::object().

Referenced by SpatialSimObjectPopulation::objectAt().

Here is the call graph for this function:

SimObject::ID SimObjectPopulation::operator() ( int  idx  )  const [inline]

Reimplemented in CuboidGridObjectPopulation.

Definition at line 89 of file SimObjectPopulation.h.

size_t SimObjectPopulation::size (  )  const [inline]

const vector<SimObject::ID::Packed>& SimObjectPopulation::idVector (  )  const [inline]

SimNetwork& SimObjectPopulation::getNet (  )  const [inline]

shared_ptr<SimObjectPopulation> SimObjectPopulation::subset ( vector< size_t > const &  subindices  )  const [inline]

Return a new SimObjectPopulation which is a subset specified by the given set of indices.

Definition at line 111 of file SimObjectPopulation.h.

References new_subset().

Here is the call graph for this function:

shared_ptr< SimObjectPopulation > SimObjectPopulation::localSubPopulation (  ) 

Definition at line 36 of file SimObjectPopulation.cpp.

References id_vec, SimNetwork::mpi_rank(), net, SimObjectPopulation(), and size().

Here is the call graph for this function:

vector< size_t > * SimObjectPopulation::localIndexes (  ) 

Definition at line 48 of file SimObjectPopulation.cpp.

References id_vec, SimNetwork::mpi_rank(), net, and size().

Here is the call graph for this function:

bool SimObjectPopulation::setFieldScale ( string const &  fieldname,
double  scale 
)

shared_ptr< SimObjectPopulation > SimObjectPopulation::record ( const SimObjectFactory recFactory,
const port_t  src_port = 0 
) [virtual]

Definition at line 14 of file SimObjectPopulation.cpp.

References id_vec, net, SimNetwork::record(), SimObjectPopulation(), and size().

Here is the call graph for this function:

shared_ptr< SimObjectPopulation > SimObjectPopulation::record ( const SimObjectFactory recFactory,
const string  field 
) [virtual]

Definition at line 25 of file SimObjectPopulation.cpp.

References id_vec, net, SimNetwork::record(), SimObjectPopulation(), and size().

Here is the call graph for this function:

SimObjectPopulation * SimObjectPopulation::new_subset ( vector< size_t > const &  indices  )  const [protected, virtual]

Return a new SpatialSimObjectPopulation which is a subset specified by the given set of indices.

Reimplemented in AugmentedSpatialPopulation, SpatialFamilyPopulation, and SpatialSimObjectPopulation.

Definition at line 58 of file SimObjectPopulation.cpp.

References net, and SimObjectPopulation().

Referenced by subset().

Here is the call graph for this function:


Friends And Related Function Documentation

friend class WiringMethod [friend]

Definition at line 64 of file SimObjectPopulation.h.

friend class OneToOneWiringMethod [friend]

Definition at line 65 of file SimObjectPopulation.h.

friend class SimpleAllToAllWiringMethod [friend]

Definition at line 66 of file SimObjectPopulation.h.

friend class DistributedSyncWiringMethod [friend]

Definition at line 67 of file SimObjectPopulation.h.


Member Data Documentation

This shared pointer is the owner of the id vector if generated in the constructor.

Definition at line 134 of file SimObjectPopulation.h.

Referenced by AugmentedSpatialPopulation::AugmentedSpatialPopulation(), AugmentedSpatialPopulation::populate(), SimObjectPopulation(), and SpatialFamilyPopulation::SpatialFamilyPopulation().

const vector< SimObject::ID::Packed >* SimObjectPopulation::id_vec [protected]


The documentation for this class was generated from the following files:

Generated on Wed Jul 9 16:34:53 2008 for PCSIM by  doxygen 1.5.5