Component.h Source File
Back to the index.
Go to the documentation of this file.
80 Component(
const string& className,
const string& visibleClassName);
124 static string GetAttribute(
const string& attributeName);
167 ostream& changeMessages)
const;
181 bool htmlLinksForClassNames =
false,
182 string prefixForComponentUrls =
"")
const;
335 const string& methodName,
336 const vector<string>& arguments);
424 bool shortestPossible =
false)
const;
437 size_t insertPosition = (
size_t) -1);
529 const string& str,
size_t& pos);
565 StateVariableMap::iterator it = m_stateVariables.find(name);
566 if (it != m_stateVariables.end())
569 m_stateVariables.insert(pair<string,StateVariable>
588 StateVariableMap::iterator it = m_stateVariables.find(name);
589 if (it != m_stateVariables.end())
592 m_stateVariables.insert(pair<string,StateVariable>
714 void AddAllComponentPaths(vector<string>& allComponentPaths)
const;
733 string m_visibleClassName;
745 #endif // COMPONENT_H
bool PreRunCheck(GXemul *gxemul)
Checks the state of this component and all its children, before starting execution.
Components & GetChildren()
Gets pointers to child components.
virtual void FlushCachedStateForComponent()
Resets the cached state of this component.
void AddChecksum(Checksum &checksum) const
Adds this component's state, including children, to a checksum.
string GenerateTreeDump(const string &branchTemplate, bool htmlLinksForClassNames=false, string prefixForComponentUrls="") const
Generates an ASCII tree dump of a component tree.
bool AddCustomVariable(const string &name, CustomStateVariableHandler *variableHandler)
Adds a custom state variable to the Component.
virtual string GenerateDetails() const
Generate details about the component.
bool AddVariable(const string &name, T *variablePointer)
Adds a state variable of type T to the Component.
void AddChild(refcount_ptr< Component > childComponent, size_t insertPosition=(size_t) -1)
Adds a reference to a child component.
virtual double GetCurrentFrequency() const
Returns the current frequency (in Hz) that the component runs at.
static refcount_ptr< Component > Deserialize(ostream &messages, const string &str, size_t &pos)
Deserializes a string into a component tree.
StateVariables make up the persistent state of Component objects.
vector< string > FindPathByPartialMatch(const string &partialPath, bool shortestPossible=false) const
Finds complete component paths, given a partial path.
virtual int Execute(GXemul *gxemul, int nrOfCycles)
Execute one or more cycles.
size_t RemoveChild(Component *childToRemove)
Removes a reference to a child component.
UI * GetUI()
Gets an UI reference for outputting debug messages during runtime.
map< string, StateVariable > StateVariableMap
Base class for a User Interface.
virtual void GetMethodNames(vector< string > &names) const
Retrieves a component's implemented method names.
virtual void ExecuteMethod(GXemul *gxemul, const string &methodName, const vector< string > &arguments)
Executes a method on the component.
void GetVariableNames(vector< string > &names) const
Retrieves a component's state variable names.
string GetClassName() const
Gets the class name of the component.
void DetectChanges(const refcount_ptr< Component > &oldClone, ostream &changeMessages) const
Compare an older clone to the current tree, to find changes.
A context used during serialization of objects.
const refcount_ptr< Component > LookupPath(string path) const
Looks up a path from this Component, and returns a pointer to the found Component,...
virtual RootComponent * AsRootComponent()
Returns the component's RootComponent interface.
bool SetVariableValue(const string &name, const string &expression)
Sets a variable to a new value.
string GenerateShortestPossiblePath() const
Generates a short string representation of the path to the Component.
Component * GetParent()
Gets this component's parent component, if any.
map< string, string > ComponentCreationSettings
A Component which is the default root node in the configuration.
virtual bool CheckVariableWrite(StateVariable &var, const string &oldValue)
Checks whether a write to a variable is OK.
bool CheckConsistency() const
Checks consistency by serializing and deserializing the component (including all its child components...
string GeneratePath() const
Generates a string representation of the path to the Component.
virtual bool MethodMayBeReexecutedWithoutArgs(const string &methodName) const
Returns whether a method name may be re-executed without args.
virtual void ResetState()
Resets the state variables of this component.
void SetParent(Component *parentComponent)
Sets the parent component of this component.
A Component is a node in the configuration tree that makes up an emulation setup.
const refcount_ptr< Component > LightClone() const
Makes a light clone of the component and all its children.
vector< refcount_ptr< Component > > Components
StateVariable * GetVariable(const string &name)
Gets a pointer to a state variable.
ComponentCreationSettings componentCreationSettings
Base class for reference countable objects.
void FlushCachedState()
Resets the cached state of this component and all its children.
virtual CPUComponent * AsCPUComponent()
Returns the component's CPUComponent interface.
An interface for implementing components that read/write data via an address bus.
static string GetAttribute(const string &attributeName)
Creates a Component.
void Serialize(ostream &ss, SerializationContext &context) const
Serializes the Component into a string stream.
refcount_ptr< Component > Clone() const
Clones the component and all its children.
virtual AddressDataBus * AsAddressDataBus()
Returns the component's AddressDataBus interface, if any.
virtual bool PreRunCheckForComponent(GXemul *gxemul)
Checks the state of this component, before starting execution.
string GetVisibleClassName() const
Gets the visible class name of the component.
GXemul * GetRunningGXemulInstance()
Returns a reference to the current GXemul instance.
A base-class for processors Component implementations.
void Reset()
Resets the state of this component and all its children.
Generated on Tue Aug 25 2020 19:25:06 for GXemul by
1.8.18