30 #ifndef CFI_DISCOVER_H
31 #define CFI_DISCOVER_H
97 std::map<std::string, std::vector<DiscoverWeakPointer> > objects;
115 void fetch(
csr name, std::vector<void *> & results);
119 #define DISCOVERABLE \
120 SASSY::cfi::DiscoveryMgr::instance().save( __PRETTY_FUNCTION__, \
121 (discover.reset( new SASSY::cfi::DiscoverPointer( this )), discover) );
A mixin class that makes its owner discoverable.
Definition: discover.h:80
Holds a pointer to a discoverable object.
Definition: discover.h:52
DiscoverSharedPointer discover
A shared pointer that references back to the discoverable object.
Definition: discover.h:84
std::weak_ptr< DiscoverPointer > DiscoverWeakPointer
A weak pointer that will be held by the DiscoveryMgr.
Definition: discover.h:71
static DiscoveryMgr & instance()
Return a reference to the DiscoveryMgr.
Definition: discover.cpp:38
DiscoverPointer()
Default constructor.
Definition: discover.h:58
std::shared_ptr< DiscoverPointer > DiscoverSharedPointer
A shared pointer that will be owned by a discoverable object.
Definition: discover.h:68
Manager for discoverable objects.
Definition: discover.h:94
DiscoverPointer(void *a)
Constructor.
Definition: discover.h:64
void * addr
Pointer to a discoverable object.
Definition: discover.h:55
const std::string & csr
Save some time typing and shorten parameter lines.
Definition: stringy.h:35
void fetch(csr name, std::vector< void * > &results)
Get a list of objects with a class name.
Definition: discover.cpp:57
void save(const char *prettyName, DiscoverSharedPointer p)
Save a discoverable object.
Definition: discover.cpp:46