9 #ifndef ThePEG_BaseRepository_H
10 #define ThePEG_BaseRepository_H
13 #include "ThePEG/Config/ThePEG.h"
14 #include "BaseRepository.xh"
15 #include "ThePEG/Interface/InterfaceBase.fh"
16 #include "ThePEG/Interface/ClassDocumentation.fh"
17 #include "ThePEG/Interface/InterfacedBase.h"
18 #include "ThePEG/Utilities/ClassDescription.fh"
64 typedef map<const ClassDescriptionBase *, const ClassDocumentationBase *>
75 static string exec(
string cmd, ostream &);
112 static void remove(
tIBPtr);
120 static string remove(
const ObjectSet & rmset);
239 template <
typename T>
247 template <
typename PtrType>
248 static PtrType
GetPtr(
string);
258 template <
typename PtrType>
332 static InterfaceMap
getInterfaces(
const type_info & ti,
bool all =
true);
359 template <
typename Cont>
360 static vector< pair<IBPtr, const InterfaceBase *> >
376 template<
typename Cont>
386 template<
typename Cont>
473 template <
typename T>
481 template <
typename T>
502 InterfaceMap &,
bool all =
true);
547 static ostream *&
coutp();
552 static ostream *&
cerrp();
556 static ostream *&
clogp();
564 #ifndef ThePEG_TEMPLATES_IN_CC_FILE
565 #include "BaseRepository.tcc"
static void rename(tIBPtr object, string newName)
Rename a given object.
static string getModelReferences(tcIBPtr ip)
Get the references for the model implemented in the class of the given object.
static void Register(const InterfaceBase &, const type_info &)
Register an interface.
static DirectorySet & directories()
All defined directories.
static string getPosArgFromNoun(string noun)
Get interface index.
ClassDescriptionBase is the base class for all class description classes.
static ostream *& cerrp()
The current current standard error stream.
static InterfaceMap getInterfaces(const type_info &ti, bool all=true)
Get interfaces.
void clear()
Calls reset() and unTouch().
static void CreateDirectory(string)
Create a new directory with the given name.
StringSet DirectorySet
A set of strings.
static void cout(ostream &os)
Set the standard output stream.
ThePEG::Ptr< InterfacedBase >::transient_pointer tIBPtr
Alias for a transient pointer to InterfacedBase .
The InterfaceBase class defines a generic interface to any class derived from the InterfacedBase clas...
FNC for_each(IteratorRange< Iterator > r, FNC f)
The std::for_each function taking an IteratorRange as argument.
static bool & updating()
Flag to say if we are in the middle of an update procedure.
static stack< string > & currentReadDirStack()
The stack of directories used by the "read" command.
static ostream & cout()
Get the standard output stream.
TransientConstRCPtr is a simple wrapper around a bare const pointer which can be assigned to and from...
TransientRCPtr is a simple wrapper around a bare pointer which can be assigned to and from an RCPtr a...
static IVector SearchDirectory(string name, string className="")
Return all objects in the directory name.
static void rebind(InterfacedBase &obj, const TranslationMap &trans, const IVector &defaults)
Rebind references.
static StringVector & directoryStack()
The current directory stack.
Rebinder is a class associating pairs of pointers to objects.
static string getInterfaceFromNoun(string noun)
Get an interface name.
This is the main namespace within which all identifiers in ThePEG are declared.
static ostream & cerr()
Get the standard error stream.
static vector< pair< IBPtr, const InterfaceBase * > > getNonDefaultInterfaces(const Cont &)
Return a list of the interfaces which do not have their default values for the given objects...
static void appendReadDir(string)
Add a directory to readDirs().
static IVector GetObjectsReferringTo(IBPtr)
Get referring objects.
static vector< string > & readDirs()
List of directories to search for files for the "read" command.
static ObjectSet & allObjects()
All InterfacedBase objects.
static IBPtr GetPointer(string)
Return a pointer to an object with the given name or null if no such object exists.
static ostream & clog()
Get the standard log stream.
static void update()
Call the InterfacedBase::update() function of all objects.
static Ptr< T >::pointer clone(const T &t)
Return a clone of the given object.
static ostream *& coutp()
The current current standard output stream.
static void addReferences(tIBPtr obj, ObjectSet &refs)
Get all references.
void reset()
Set the state of this object to uninitialized.
static void CheckDirectory(string)
Check if directory exixts.
static IBPtr TraceObject(string name)
Find an object.
static const ClassDocumentationBase * getDocumentation(tcIBPtr ip)
Return the class documentation of a given object.
static void CheckObjectDirectory(string)
Check if directory exixts.
static void clog(ostream &os)
Set the standard log stream.
BaseRepository is a purely static class which keeps a set of InterfacedBase objects indexed by their ...
InterfacedBase is the base class of all Interfaced objects to be handled by the BaseRepository class...
static ostream *& clogp()
The current current standard log stream.
RCPtr is a reference counted (smart) pointer.
static const InterfaceBase * FindInterface(IBPtr object, string name)
Return an interface with the given name to the given object.
static Ptr< T >::pointer fullclone(const T &t)
Return a clone of the given object.
static TypeDocumentationMap & documentations()
Sets of ClassDocumentationBase objects mapped to the class description of the class for which they ar...
static void PopDirectory()
Pop the directory stack.
static void DirectoryAppend(string &)
Return the absolute path.
static void prependReadDir(string)
Add a directory to readDirs().
vector< string > StringVector
A vector of character strings.
map< const ClassDescriptionBase *, InterfaceSet > TypeInterfaceMap
A map of sets of IterfaceBase objects indexed by pointers to ClassDescriptionBase objects...
map< const ClassDescriptionBase *, const ClassDocumentationBase * > TypeDocumentationMap
A map of ClassDocumentationBase objects indexed by pointers to ClassDescriptionBase objects...
static void clearAll(const Cont &c)
Clear the InterfacedBase::touched() flag in all objects in the given container.
static void addInterfaces(const ClassDescriptionBase &, InterfaceMap &, bool all=true)
Add interfaces to the given map for the class with the given class description.
The ClassDocumentationBase class is used to communicate documetation about an Interfaced class to the...
static void unlock(tIBPtr ip)
Unlock the given object.
static string getModelDescription(tcIBPtr ip)
Get the description for the model implemented in the class of the given object.
set< const InterfaceBase * > InterfaceSet
A set of pointers to InterfaceBase objects.
static void resetAll(const Cont &c)
Set the status of all objects in the given container to InterfacedBase::uninitialized.
static void cerr(ostream &os)
Set the standard error stream.
static IBPtr getObjectFromNoun(string noun)
Get an object.
static IVector DirectReferences(IBPtr)
Get direct references.
static void lock(tIBPtr ip)
Lock the given object.
static void readSetup(tIBPtr ip, istream &is)
Setup an object.
static void ChangeDirectory(string name)
Set the current directory to name.
vector< IBPtr > IVector
A vector of pointers to InterfacedBase objects.
static Ptr< T >::pointer GetPtr(const T &)
Return a reference counted pointer to the given object.
static void PushDirectory(string name)
Set the current directory to name.
static vector< string > & globalLibraries()
A list of all globally loaded libraries.
static ObjectMap & objects()
All InterfacedBase objects mapped to their name.
static string exec(string cmd, ostream &)
Interpret the command in cmd and return possible messages.
static TypeInterfaceMap & interfaces()
Sets of InterfaceBase objects mapped to the class description of the class for which they are defined...
static string GetInterfacedBaseClasses(const ClassDescriptionBase *cdb)
Return a string containing the name of the given class description and its base classes, one on each line.
static PtrType GetObject(string)
Return a pointer of the specified type to an object with the given name.