#include <Id.h>
Public Member Functions | |
Id () | |
Id (unsigned int id) | |
Id (const std::string &path, const std::string &separator="/") | |
Id (const ObjId &oi) | |
~Id () | |
void | bindIdToElement (Element *e) |
void | destroy () const |
std::string | path (const std::string &separator="/") const |
Element * | element () const |
Synonym for Id::operator()(). | |
Eref | eref () const |
unsigned int | value () const |
bool | operator== (const Id &other) const |
bool | operator!= (const Id &other) const |
bool | operator< (const Id &other) const |
void | zeroOut () const |
Static Public Member Functions | |
static Id | nextId () |
static unsigned int | numIds () |
static Id | str2Id (const std::string &s) |
static std::string | id2str (Id id) |
static bool | isValid (Id id) |
static bool | isValid (unsigned int id) |
static void | clearAllElements () |
Friends | |
ostream & | operator<< (ostream &s, const Id &i) |
istream & | operator>> (istream &s, Id &i) |
This class manages id lookups for elements. Ids provide a uniform handle for every object, independent of which node they are located on.
Id::Id | ( | unsigned int | id | ) |
Creates an id with the specified Element number
Id::Id | ( | const std::string & | path, | |
const std::string & | separator = "/" | |||
) |
Returns an id found by traversing the specified path
References Shell::doFind(), ObjId::id, and Id().
Id::~Id | ( | ) | [inline] |
Destroys an Id. Doesn't do anything much.
void Id::bindIdToElement | ( | Element * | e | ) |
The specified element is placed into current id.
void Id::clearAllElements | ( | ) | [static] |
Used to clean up all Elements when the simulation is terminated
Referenced by main().
void Id::destroy | ( | ) | const |
Cleanly deletes the associated Element, and zeroes out contents of elements vector at the location pointed to by this->id_.
Referenced by Cell::setupf(), testArith(), testFibonacci(), testLookupSetGet(), testMpiFibonacci(), testMsgSrcDestFields(), testSetGetExtField(), testSharedMsg(), and testShellParserStart().
Element * Id::element | ( | ) | const |
Synonym for Id::operator()().
Returns the Element pointed to by the id If it is off-node, returns an allocated wrapper element with postmaster and id information. Calling func has to free it. This wrapper element may also point to UNKNOWN NODE, in which case the master node IdManager has to figure out where it belongs. Returns 0 on failure. Deprecated. Element* operator()() const; Returns the Element pointed to by the Id. Perhaps cleaner to use than operator()() as it is an explicit function.
Here we work with a single big array of all ids. Off-node elements are represented by their postmasters. When we hit a postmaster we put the id into a special field on it. Note that this is horrendously thread-unsafe.
Referenced by Shell::adopt(), checkChildren(), SparseMsg::copy(), SingleMsg::copy(), OneToOneMsg::copy(), OneToOneDataIndexMsg::copy(), OneToAllMsg::copy(), DiagonalMsg::copy(), FieldElement::data(), Shell::doMove(), Element::dropAllMsgsFromSrc(), fillSegIndex(), NeuroMesh::filterSpines(), findMeshOfEnz(), findModelParent(), DiagonalMsg::findOtherEnd(), findParentComptOfReac(), FieldElement::getNode(), FieldElement::getNumOnNode(), Stoich::getProxyPools(), LookupField< L, A >::getVec(), innerCopyElements(), Shell::innerMove(), Stoich::installAndUnschedFunc(), Stoich::installAndUnschedFuncRate(), Stoich::installAndUnschedFuncReac(), isDoingReinit(), FieldElement::isGlobal(), Shell::isRunning(), FieldElement::localDataStart(), main(), FieldElement::numData(), FieldElement::numField(), FieldElement::numLocalData(), FieldElementFinfoBase::postCreationFunc(), FieldElement::rawIndex(), FieldElement::resizeField(), SrcFinfo2< T1, T2 >::sendTo(), SrcFinfo1< T >::sendTo(), ZombiePoolInterface::setCompartment(), Stoich::setCompartment(), Gsolve::setCompartment(), Stoich::setDsolve(), Ksolve::setDsolve(), Gsolve::setDsolve(), Stoich::setKsolve(), HSolve::setSeed(), ZombieReac::setSolver(), ZombieMMenz::setSolver(), ZombieFunction::setSolver(), ZombieEnz::setSolver(), Neuron::setSpineAndPsdMesh(), SteadyState::setStoich(), Ksolve::setStoich(), Gsolve::setStoich(), showFields(), FieldElement::startDataIndex(), test2ArgSetVec(), testAssortedMsg(), testCopy(), testCopyFieldElement(), testCreateMsg(), testFilterOffNodeTargets(), testGet(), testMsgField(), testMsgSrcDestFields(), testSendMsg(), testSendSpike(), testSetGet(), testSetGetDouble(), testSetGetVec(), testSharedMsg(), testStrGet(), testStrSet(), testTreeTraversal(), testTwoReacGetNeighbors(), tryParent(), ZombiePool::vSetSolver(), ZombieHHChannel::vSetSolver(), ZombieCompartment::vSetSolver(), and ZombieCaConc::vSetSolver().
Eref Id::eref | ( | ) | const |
Returns the Eref to the element plus index
Referenced by ReadCell::addChannelMessage(), ReadKkit::assignPoolCompartments(), checkChildren(), OneToOneMsg::copy(), OneToOneDataIndexMsg::copy(), MarkovSolverBase::init(), init(), innerCopyElements(), Neutral::isDescendant(), isDoingReinit(), Shell::isRunning(), Shell::launchParser(), ReadCspace::makePlots(), path(), FieldElementFinfoBase::postCreationFunc(), HSolveUtils::rates(), Stoich::setDsolve(), Ksolve::setDsolve(), Gsolve::setDsolve(), MarkovRateTable::setInt2dChildTable(), Stoich::setKsolve(), ZombieReac::setSolver(), ZombieMMenz::setSolver(), ZombieEnz::setSolver(), Neuron::setSpineAndPsdMesh(), SteadyState::setStoich(), Ksolve::setStoich(), Gsolve::setStoich(), MarkovRateTable::setVtChildTable(), Element::showFields(), storeFunctionMsgs(), testClock(), testCopy(), testCreateMsg(), testGetMsg(), testMMenz(), testMove(), testMsgField(), testMsgSrcDestFields(), testSendMsg(), testSendSpike(), testSharedMsg(), verifyKids(), ZombieHHChannel::vSetSolver(), ZombieCompartment::vSetSolver(), and ZombieCaConc::vSetSolver().
string Id::id2str | ( | Id | id | ) | [static] |
Returns a string holding the ascii value of the id_ .
static bool Id::isValid | ( | unsigned int | id | ) | [inline, static] |
static bool Id::isValid | ( | Id | id | ) | [inline, static] |
Id Id::nextId | ( | ) | [static] |
Reserves an id for assigning to an Element. Each time it is called a new id is reserved, even if previous ones have not been used yet.
Referenced by buildFinfoElement(), init(), Msg::initMsgManagers(), innerCopyElements(), Cinfo::makeCinfoElements(), FieldElementFinfoBase::postCreationFunc(), showFields(), test2ArgSetVec(), testArith(), testClock(), testCreateMsg(), testFibonacci(), testGet(), testLookupSetGet(), testMsgField(), testMsgSrcDestFields(), testSendMsg(), testSendSpike(), testSetGet(), testSetGetDouble(), testSetGetExtField(), testSetGetSynapse(), testSetGetVec(), testSetRepeat(), testSharedMsg(), testSparseMsg(), testStrGet(), and testStrSet().
unsigned int Id::numIds | ( | ) | [static] |
Returns the number of Ids in use.
bool Id::operator!= | ( | const Id & | other | ) | const [inline] |
bool Id::operator< | ( | const Id & | other | ) | const [inline] |
bool Id::operator== | ( | const Id & | other | ) | const [inline] |
string Id::path | ( | const std::string & | separator = "/" |
) | const |
Returns the full pathname of the object on the id.
References eref().
Referenced by Neuron::buildSegmentTree(), diagnoseTree(), findModelParent(), HSolveUtils::gates(), LookupField< L, A >::getVec(), installDummy(), ReadCspace::makePlots(), makeStandardElements(), Ksolve::print(), ReadCell::ReadCell(), Ksolve::setDsolve(), Gsolve::setDsolve(), setMethod(), HSolve::setSeed(), Neuron::setSpineAndPsdMesh(), Cell::setupf(), storePlotMsgs(), ReadCspace::testReadModel(), testTreeTraversal(), Conv< Id >::val2str(), RandGenerator::vReinit(), ZombieHHChannel::vSetSolver(), ZombieCompartment::vSetSolver(), ZombieCaConc::vSetSolver(), writeGroup(), and writeKkit().
Id Id::str2Id | ( | const std::string & | s | ) | [static] |
Returns an id whose value is string-converted from the specified string.
Static func to extract an id from a string. We need to accept ids out of the existing range, but it would be nice to have a heuristic on how outrageous the incoming value is.
References Id().
unsigned int Id::value | ( | ) | const |
Referenced by init(), Stoich::installAndUnschedFunc(), Stoich::installAndUnschedFuncRate(), Stoich::installAndUnschedFuncReac(), makeReacTest(), storeFunctionMsgs(), testCopyFieldElement(), testObjIdToAndFromPath(), testPoolVolumeScaling(), testReacVolumeScaling(), testSendSpike(), testSetGetExtField(), testSetGetSynapse(), testSetGetVec(), testSetRepeat(), testSparseMsg(), testSyncSynapseSize(), testTreeTraversal(), and testTwoReacGetNeighbors().
void Id::zeroOut | ( | ) | const |
Used to clean out any specific Id.
Referenced by Element::~Element().
ostream& operator<< | ( | ostream & | s, | |
const Id & | i | |||
) | [friend] |
istream& operator>> | ( | istream & | s, | |
Id & | i | |||
) | [friend] |