Version: 9.16.0
YACS::HMI::SubjectProc Class Reference

#include <guiObservers.hxx>

Inheritance diagram for YACS::HMI::SubjectProc:
Collaboration diagram for YACS::HMI::SubjectProc:

Public Member Functions

 SubjectProc (YACS::ENGINE::Proc *proc, Subject *parent)
 
virtual ~SubjectProc ()
 
void loadProc ()
 
void loadComponents ()
 
void loadContainers ()
 
void loadTypes ()
 Load types for a SubjectProc. More...
 
virtual SubjectComponentaddComponent (std::string compoName, std::string containerName="")
 
virtual SubjectContainerBaseaddContainer (std::string name, std::string ref="")
 
virtual SubjectContainerBaseaddHPContainer (std::string name, std::string ref="")
 
virtual bool addDataType (YACS::ENGINE::Catalog *catalog, std::string typeName)
 
SubjectComponentaddSubjectComponent (YACS::ENGINE::ComponentInstance *compo)
 
SubjectContainerBaseaddSubjectContainer (YACS::ENGINE::Container *cont, std::string name="")
 
SubjectDataTypeaddComSubjectDataType (YACS::ENGINE::TypeCode *type, std::string alias)
 
SubjectDataTypeaddSubjectDataType (YACS::ENGINE::TypeCode *type, std::string alias)
 
void removeSubjectDataType (std::string typeName)
 
void removeSubjectContainer (SubjectContainerBase *scont)
 
virtual void clean (Command *command=0)
 
void localclean (Command *command=0)
 
void addPostErase (Subject *sub)
 
void cleanPostErase ()
 
virtual TypeOfElem getType ()
 
- Public Member Functions inherited from YACS::HMI::SubjectBloc
 SubjectBloc (YACS::ENGINE::Bloc *bloc, Subject *parent)
 
virtual ~SubjectBloc ()
 
virtual SubjectNodeaddNode (YACS::ENGINE::Catalog *catalog, std::string compo, std::string type, std::string name, bool newCompoInst)
 
virtual void removeNode (SubjectNode *child)
 
virtual void completeChildrenSubjectList (SubjectNode *son)
 
virtual SubjectNodegetChild (YACS::ENGINE::Node *node=0) const
 
virtual void recursiveUpdate (GuiEvent event, int type, Subject *son)
 
virtual void houseKeepingAfterCutPaste (bool isCut, SubjectNode *son)
 
virtual void clean (Command *command=0)
 
void localclean (Command *command=0)
 
virtual TypeOfElem getType ()
 
- Public Member Functions inherited from YACS::HMI::SubjectComposedNode
 SubjectComposedNode (YACS::ENGINE::ComposedNode *composedNode, Subject *parent)
 
virtual ~SubjectComposedNode ()
 
virtual SubjectNodeaddNode (YACS::ENGINE::Catalog *catalog, std::string compo, std::string type, std::string name, bool newCompoInst)
 
virtual SubjectNodegetChild (YACS::ENGINE::Node *node=0) const
 
virtual void loadChildren ()
 
virtual void loadLinks ()
 
virtual void completeChildrenSubjectList (SubjectNode *son)
 
SubjectNodeaddSubjectNode (YACS::ENGINE::Node *node, std::string name="", YACS::ENGINE::Catalog *catalog=0, std::string compo="", std::string type="")
 
SubjectLinkaddSubjectLink (SubjectNode *sno, SubjectDataPort *spo, SubjectNode *sni, SubjectDataPort *spi)
 
SubjectControlLinkaddSubjectControlLink (SubjectNode *sno, SubjectNode *sni)
 
virtual void removeLink (SubjectLink *link)
 
virtual void removeControlLink (SubjectControlLink *link)
 
virtual void removeExternalControlLinks ()
 
virtual void houseKeepingAfterCutPaste (bool isCut, SubjectNode *son)
 
virtual bool hasValue ()
 
virtual std::string getValue ()
 
virtual void clean (Command *command=0)
 
void localclean (Command *command=0)
 
- Public Member Functions inherited from YACS::HMI::SubjectNode
 SubjectNode (YACS::ENGINE::Node *node, Subject *parent)
 
virtual ~SubjectNode ()
 
virtual bool setProperties (std::map< std::string, std::string > properties)
 
virtual std::map< std::string, std::string > getProperties ()
 
virtual bool reparent (Subject *parent)
 
virtual bool copy (Subject *parent)
 
virtual std::string getName ()
 
virtual bool setName (std::string name)
 
virtual YACS::ENGINE::NodegetNode ()
 
virtual void clean (Command *command=0)
 
void registerUndoDestroy ()
 
SubjectControlLinkaddSubjectControlLink (SubjectControlLink *sub)
 
void removeSubjectControlLink (SubjectControlLink *sub)
 
std::list< SubjectLink * > getSubjectLinks () const
 
std::list< SubjectControlLink * > getSubjectControlLinks () const
 
std::list< SubjectInputPort * > getSubjectInputPorts () const
 
std::list< SubjectOutputPort * > getSubjectOutputPorts () const
 
std::list< SubjectInputDataStreamPort * > getSubjectInputDataStreamPorts () const
 
std::list< SubjectOutputDataStreamPort * > getSubjectOutputDataStreamPorts () const
 
void localclean (Command *command=0)
 
virtual void update (GuiEvent event, int type, Subject *son)
 
virtual void recursiveUpdate (GuiEvent event, int type, Subject *son)
 
virtual void removeExternalLinks ()
 
virtual void removeExternalControlLinks ()
 
virtual void saveLinks ()
 
virtual void restoreLinks ()
 
virtual bool putInComposedNode (std::string name, std::string type, bool toSaveRestoreLinks=true)
 
virtual int isValid ()
 
void setExecState (int execState)
 
- Public Member Functions inherited from YACS::HMI::Subject
 Subject (Subject *parent=0)
 
virtual ~Subject ()
 
virtual void attach (GuiObserver *obs)
 
virtual void detach (GuiObserver *obs)
 
virtual void select (bool isSelected)
 
virtual void update (GuiEvent event, int type, Subject *son)
 
virtual std::string getName ()
 
virtual bool setName (std::string name)
 
virtual bool setProperties (std::map< std::string, std::string > properties)
 
virtual std::map< std::string, std::string > getProperties ()
 
virtual std::vector< std::string > knownProperties ()
 
virtual SubjectgetParent ()
 
virtual void setParent (Subject *son)
 
virtual bool destroy (Subject *son)
 From user action in Ihm, destroy an object. More...
 
virtual void loadChildren ()
 
virtual void loadLinks ()
 
virtual void addSubjectReference (Subject *ref)
 
virtual void clean (Command *command=0)
 
void localclean (Command *command=0)
 
void registerUndoDestroy ()
 
void askRegisterUndoDestroy ()
 
bool isDestructible ()
 
virtual TypeOfElem getType ()
 
virtual void setProgress (std::string newProgress)
 
virtual std::string getProgress ()
 
- Public Member Functions inherited from YACS::ENGINE::Observer
virtual void notifyObserver (Node *object, const std::string &event)
 
virtual void notifyObserver2 (Node *object, const std::string &event, void *something)
 
virtual void notifyObserverFromClone (Node *originalInstance, const std::string &event, Node *clonedInstanceGeneratingEvent)
 
virtual ~Observer ()
 

Protected Attributes

YACS::ENGINE::Proc_proc
 
std::vector< Subject * > _postEraseList
 
- Protected Attributes inherited from YACS::HMI::SubjectBloc
YACS::ENGINE::Bloc_bloc
 
std::set< SubjectNode * > _children
 
- Protected Attributes inherited from YACS::HMI::SubjectComposedNode
YACS::ENGINE::ComposedNode_composedNode
 
- Protected Attributes inherited from YACS::HMI::SubjectNode
YACS::ENGINE::Node_node
 
std::list< SubjectInputPort * > _listSubjectInputPort
 
std::list< SubjectOutputPort * > _listSubjectOutputPort
 
std::list< SubjectInputDataStreamPort * > _listSubjectIDSPort
 
std::list< SubjectOutputDataStreamPort * > _listSubjectODSPort
 
std::list< SubjectLink * > _listSubjectLink
 
std::list< SubjectControlLink * > _listSubjectControlLink
 
int _execState
 
std::list< YACS::ENGINE::OutGate * > loutgate
 
std::list< YACS::ENGINE::InGate * > singate
 
std::vector< std::pair< YACS::ENGINE::OutPort *, YACS::ENGINE::InPort * > > dataLinks
 
std::vector< std::pair< YACS::ENGINE::OutPort *, YACS::ENGINE::InPort * > > dataflowLinks
 
- Protected Attributes inherited from YACS::HMI::Subject
std::set< GuiObserver * > _setObs
 
Subject_parent
 
bool _destructible
 
bool _askRegisterUndo
 
std::string _progress
 

Additional Inherited Members

- Static Public Member Functions inherited from YACS::HMI::SubjectComposedNode
static SubjectComposedNodegetLowestCommonAncestor (SubjectNode *snode1, SubjectNode *snode2)
 Retrieves the lowest common ancestor of 2 nodes. More...
 
- Static Public Member Functions inherited from YACS::HMI::SubjectNode
static bool tryCreateLink (SubjectNode *subOutNode, SubjectNode *subInNode)
 
- Static Public Member Functions inherited from YACS::HMI::Subject
static void erase (Subject *sub, Command *command=0, bool post=false)
 
- Protected Member Functions inherited from YACS::HMI::SubjectComposedNode
virtual SubjectNodecreateNode (YACS::ENGINE::Catalog *catalog, std::string compo, std::string type, std::string name, bool newCompoInst, int swCase=0)
 
- Protected Member Functions inherited from YACS::HMI::SubjectNode
virtual SubjectInputPortaddSubjectInputPort (YACS::ENGINE::InputPort *port, std::string name="")
 
virtual SubjectOutputPortaddSubjectOutputPort (YACS::ENGINE::OutputPort *port, std::string name="")
 
virtual SubjectInputDataStreamPortaddSubjectIDSPort (YACS::ENGINE::InputDataStreamPort *port, std::string name="")
 
virtual SubjectOutputDataStreamPortaddSubjectODSPort (YACS::ENGINE::OutputDataStreamPort *port, std::string name="")
 
virtual void notifyObserver (YACS::ENGINE::Node *object, const std::string &event)
 

Detailed Description

Definition at line 507 of file guiObservers.hxx.

Constructor & Destructor Documentation

◆ SubjectProc()

SubjectProc::SubjectProc ( YACS::ENGINE::Proc proc,
Subject parent 
)

Definition at line 1802 of file guiObservers.cxx.

1803 : SubjectBloc(proc, parent), _proc(proc)
1804{
1805 _postEraseList.clear();
1806}
SubjectBloc(YACS::ENGINE::Bloc *bloc, Subject *parent)
std::vector< Subject * > _postEraseList
YACS::ENGINE::Proc * _proc

References _postEraseList.

◆ ~SubjectProc()

SubjectProc::~SubjectProc ( )
virtual

Definition at line 1808 of file guiObservers.cxx.

1809{
1810 DEBTRACE("SubjectProc::~SubjectProc " << getName());
1811}
#define DEBTRACE(msg)
Definition: YacsTrace.hxx:31
virtual std::string getName()

References DEBTRACE, and YACS::HMI::SubjectNode::getName().

Member Function Documentation

◆ addComponent()

SubjectComponent * SubjectProc::addComponent ( std::string  compoName,
std::string  containerName = "" 
)
virtual

Definition at line 1906 of file guiObservers.cxx.

1907{
1908 DEBTRACE("SubjectProc::addComponent " << compoName << " " << containerName);
1909 CommandAddComponentInstance *command = new CommandAddComponentInstance(compoName, containerName);
1910 if (command->execute())
1911 {
1912 GuiContext::getCurrent()->getInvoc()->add(command);
1913 return command->getSubjectComponent();
1914 }
1915 else delete command;
1916 return 0;
1917}
virtual bool execute()
the command is executed a first time after its registration for undo redo, then on redo
Definition: commands.cxx:51
static GuiContext * getCurrent()
Definition: guiContext.hxx:67
YACS::HMI::ProcInvoc * getInvoc()
Definition: guiContext.hxx:51
void add(Command *command)
Definition: commands.cxx:156

References YACS::HMI::Invocator::add(), DEBTRACE, YACS::HMI::Command::execute(), YACS::HMI::GuiContext::getCurrent(), YACS::HMI::GuiContext::getInvoc(), and YACS::HMI::CommandAddComponentInstance::getSubjectComponent().

Referenced by YACS::HMI::GuiEditor::CreateComponentInstance().

◆ addComSubjectDataType()

SubjectDataType * SubjectProc::addComSubjectDataType ( YACS::ENGINE::TypeCode type,
std::string  alias 
)

register a sub command when importing a node from catalog with new data types

Definition at line 1993 of file guiObservers.cxx.

1994{
1995 string typeName = type->name();
1996 DEBTRACE("SubjectProc::addComSubjectDataType " << typeName);
1997 SubjectDataType* son = 0;
1998 if (GuiContext::getCurrent()->isLoading())
1999 son = addSubjectDataType(type,alias); // no sub command registration
2000 else
2001 {
2004 typeName);
2005 if (command->execute())
2006 GuiContext::getCurrent()->getInvoc()->add(command);
2007 else delete command;
2008 }
2009 return son;
2010}
class for YACS catalogs.
Definition: Catalog.hxx:42
virtual const char * name() const
Definition: TypeCode.cxx:72
YACS::ENGINE::Catalog * getCurrentCatalog()
Definition: guiContext.hxx:48
SubjectDataType * addSubjectDataType(YACS::ENGINE::TypeCode *type, std::string alias)

References YACS::HMI::Invocator::add(), addSubjectDataType(), DEBTRACE, YACS::HMI::Command::execute(), YACS::HMI::GuiContext::getCurrent(), YACS::HMI::GuiContext::getCurrentCatalog(), YACS::HMI::GuiContext::getInvoc(), and YACS::ENGINE::TypeCode::name().

Referenced by YACS::HMI::SubjectNode::addSubjectIDSPort(), YACS::HMI::SubjectNode::addSubjectODSPort(), and YACS::HMI::SubjectNode::addSubjectOutputPort().

◆ addContainer()

SubjectContainerBase * SubjectProc::addContainer ( std::string  name,
std::string  ref = "" 
)
virtual

Definition at line 1919 of file guiObservers.cxx.

1920{
1921 DEBTRACE("SubjectProc::addContainer " << name << " " << ref);
1922 if (! GuiContext::getCurrent()->getProc()->containerMap.count(name))
1923 {
1924 CommandAddContainer *command(new CommandAddContainer(name,ref));
1925 if (command->execute())
1926 {
1927 GuiContext::getCurrent()->getInvoc()->add(command);
1928 return command->getSubjectContainer();
1929 }
1930 else
1931 delete command;
1932 }
1933 else GuiContext::getCurrent()->_lastErrorMessage = "There is already a container with that name";
1934 return 0;
1935}
std::string _lastErrorMessage
Definition: guiContext.hxx:79
def ref(target, callback=None)
Definition: CONNECTOR.py:120

References YACS::HMI::GuiContext::_lastErrorMessage, YACS::HMI::Invocator::add(), DEBTRACE, YACS::HMI::Command::execute(), YACS::HMI::GuiContext::getCurrent(), YACS::HMI::GuiContext::getInvoc(), YACS::HMI::CommandAddContainerBase::getSubjectContainer(), and gui.CONNECTOR::ref().

Referenced by YACS::HMI::SchemaDirContainersItem::addComponentItem(), and YACS::HMI::GuiEditor::CreateContainer().

◆ addDataType()

bool SubjectProc::addDataType ( YACS::ENGINE::Catalog catalog,
std::string  typeName 
)
virtual

Definition at line 1955 of file guiObservers.cxx.

1956{
1957 DEBTRACE("SubjectProc::addDataType " << typeName);
1958 CommandAddDataTypeFromCatalog *command = new CommandAddDataTypeFromCatalog(catalog, typeName);
1959 if (command->execute())
1960 {
1961 DEBTRACE("new datatype " << typeName);
1962 GuiContext::getCurrent()->getInvoc()->add(command);
1963 return true;
1964 }
1965 else delete command;
1966 return 0;
1967}

References YACS::HMI::Invocator::add(), DEBTRACE, YACS::HMI::Command::execute(), YACS::HMI::GuiContext::getCurrent(), and YACS::HMI::GuiContext::getInvoc().

Referenced by YACS::HMI::GuiEditor::AddTypeFromCatalog().

◆ addHPContainer()

SubjectContainerBase * SubjectProc::addHPContainer ( std::string  name,
std::string  ref = "" 
)
virtual

Definition at line 1937 of file guiObservers.cxx.

1938{
1939 DEBTRACE("SubjectProc::addContainer " << name << " " << ref);
1940 if (! GuiContext::getCurrent()->getProc()->containerMap.count(name))
1941 {
1943 if (command->execute())
1944 {
1945 GuiContext::getCurrent()->getInvoc()->add(command);
1946 return command->getSubjectContainer();
1947 }
1948 else
1949 delete command;
1950 }
1951 else GuiContext::getCurrent()->_lastErrorMessage = "There is already a container with that name";
1952 return 0;
1953}

References YACS::HMI::GuiContext::_lastErrorMessage, YACS::HMI::Invocator::add(), DEBTRACE, YACS::HMI::Command::execute(), YACS::HMI::GuiContext::getCurrent(), YACS::HMI::GuiContext::getInvoc(), YACS::HMI::CommandAddContainerBase::getSubjectContainer(), and gui.CONNECTOR::ref().

Referenced by YACS::HMI::GuiEditor::CreateHPContainer().

◆ addPostErase()

void YACS::HMI::SubjectProc::addPostErase ( Subject sub)
inline

Definition at line 528 of file guiObservers.hxx.

528{_postEraseList.push_back(sub); };

References _postEraseList.

Referenced by YACS::HMI::SubjectServiceNode::~SubjectServiceNode().

◆ addSubjectComponent()

SubjectComponent * SubjectProc::addSubjectComponent ( YACS::ENGINE::ComponentInstance compo)

◆ addSubjectContainer()

SubjectContainerBase * SubjectProc::addSubjectContainer ( YACS::ENGINE::Container cont,
std::string  name = "" 
)

Definition at line 1979 of file guiObservers.cxx.

1980{
1981 DEBTRACE("SubjectProc::addSubjectContainer " << name);
1983 // In edition mode do not clone containers
1984 // cont->attachOnCloning(); // agy : do not use _attachOnCloning attribute in edition mode. This attribute should be used now at runtime.
1986 update(ADD, CONTAINER, son);
1987 return son;
1988}
std::map< YACS::ENGINE::Container *, YACS::HMI::SubjectContainerBase * > _mapOfSubjectContainer
Definition: guiContext.hxx:75
static SubjectContainerBase * New(YACS::ENGINE::Container *container, Subject *parent)

References YACS::HMI::GuiContext::_mapOfSubjectContainer, YACS::HMI::ADD, YACS::HMI::CONTAINER, DEBTRACE, YACS::HMI::GuiContext::getCurrent(), YACS::HMI::SubjectContainerBase::New(), and YACS::HMI::SubjectNode::update().

Referenced by loadContainers(), YACS::HMI::CommandAddContainerBase::localExecute(), YACS::HMI::SubjectServiceNode::setComponent(), and YACS::HMI::SubjectComponent::setContainer().

◆ addSubjectDataType()

SubjectDataType * SubjectProc::addSubjectDataType ( YACS::ENGINE::TypeCode type,
std::string  alias 
)

Definition at line 2013 of file guiObservers.cxx.

2014{
2015 string typeName = type->name();
2016 DEBTRACE("SubjectProc::addSubjectDataType " << typeName);
2017 Proc* proc = GuiContext::getCurrent()->getProc();
2018 SubjectDataType* son = 0;
2019 if (! proc->typeMap.count(typeName))
2020 proc->typeMap[ typeName ] = type->clone();
2021 else
2022 proc->typeMap[ typeName ]->incrRef();
2023 if (! GuiContext::getCurrent()->_mapOfSubjectDataType.count(typeName))
2024 {
2025 son = new SubjectDataType(type, this, alias);
2027 update(ADD, DATATYPE, son);
2028 }
2029 else
2030 GuiContext::getCurrent()->_lastErrorMessage = "Typecode " + typeName + " was already added in proc";
2031 return son;
2032}
Base class for all schema objects.
Definition: Proc.hxx:44
std::map< std::string, TypeCode * > typeMap
Definition: Proc.hxx:90
virtual TypeCode * clone() const
Definition: TypeCode.cxx:52
std::map< std::string, YACS::HMI::SubjectDataType * > _mapOfSubjectDataType
Definition: guiContext.hxx:76
YACS::ENGINE::Proc * getProc()
Definition: guiContext.hxx:50

References YACS::HMI::GuiContext::_lastErrorMessage, YACS::HMI::GuiContext::_mapOfSubjectDataType, YACS::HMI::ADD, YACS::ENGINE::TypeCode::clone(), YACS::HMI::DATATYPE, DEBTRACE, YACS::HMI::GuiContext::getCurrent(), YACS::HMI::GuiContext::getProc(), YACS::ENGINE::TypeCode::name(), YACS::ENGINE::Proc::typeMap, and YACS::HMI::SubjectNode::update().

Referenced by addComSubjectDataType(), YACS::HMI::SubjectNode::addSubjectInputPort(), loadTypes(), and YACS::HMI::CommandAddDataTypeFromCatalog::localExecute().

◆ clean()

void SubjectProc::clean ( Command command = 0)
virtual

Clean process prior to delete is redefined in derived classes: a local clean treatment relative to the derived class, then a call to the parent class clean method.

Reimplemented from YACS::HMI::SubjectBloc.

Definition at line 1813 of file guiObservers.cxx.

1814{
1815 if (_askRegisterUndo)
1816 {
1817 _askRegisterUndo = false;
1819 }
1820 localclean(command);
1821 SubjectBloc::clean(command);
1822}
virtual void clean(Command *command=0)
void localclean(Command *command=0)

References YACS::HMI::Subject::_askRegisterUndo, YACS::HMI::SubjectBloc::clean(), localclean(), and YACS::HMI::SubjectNode::registerUndoDestroy().

Referenced by YACS::HMI::GuiContext::~GuiContext(), and YACS::HMI::QtGuiContext::~QtGuiContext().

◆ cleanPostErase()

void SubjectProc::cleanPostErase ( )

Definition at line 1829 of file guiObservers.cxx.

1830{
1831 DEBTRACE("SubjectProc::cleanPostErase");
1832 for (int i=0; i<_postEraseList.size(); i++)
1833 {
1834 DEBTRACE("cleanPostErase " << _postEraseList[i]->getName());
1835 erase(_postEraseList[i],0, true); // --- true: do not call recursively erase
1836 }
1837 _postEraseList.clear();
1838}
static void erase(Subject *sub, Command *command=0, bool post=false)

References _postEraseList, DEBTRACE, YACS::HMI::Subject::erase(), YACS::HMI::SubjectNode::getName(), and yacsorb.CORBAEngineTest::i.

Referenced by YACS::HMI::Subject::erase().

◆ getType()

virtual TypeOfElem YACS::HMI::SubjectProc::getType ( )
inlinevirtual

Reimplemented from YACS::HMI::SubjectBloc.

Definition at line 530 of file guiObservers.hxx.

530{return SALOMEPROC;}

References YACS::HMI::SALOMEPROC.

◆ loadComponents()

void SubjectProc::loadComponents ( )

loadComponents is used when an existing scheme has been loaded in memory, to create subjects for components stored in the schema file, but are not associated with any service nodes. Note, that if such component is associated to any container, the subject for this container is also created, if it is not exist yet.

Definition at line 1875 of file guiObservers.cxx.

1876{
1877 Proc* aProc = GuiContext::getCurrent()->getProc();
1878 for (map<string, ComponentInstance*>::const_iterator itComp = aProc->componentInstanceMap.begin();
1879 itComp != aProc->componentInstanceMap.end(); ++itComp)
1880 {
1881 GuiContext::getCurrent()->_mapOfLastComponentInstance[itComp->second->getCompoName()]=itComp->second;
1882
1883 if ( GuiContext::getCurrent()->_mapOfSubjectComponent.find((*itComp).second)
1884 ==
1886 { // engine object for component already exists => add only a subject for it
1887 addSubjectComponent((*itComp).second);
1888 }
1889 }
1890}
std::map< std::string, ComponentInstance * > componentInstanceMap
Definition: Proc.hxx:92
std::map< std::string, YACS::ENGINE::ComponentInstance * > _mapOfLastComponentInstance
Definition: guiContext.hxx:78
SubjectComponent * addSubjectComponent(YACS::ENGINE::ComponentInstance *compo)

References YACS::HMI::GuiContext::_mapOfLastComponentInstance, YACS::HMI::GuiContext::_mapOfSubjectComponent, addSubjectComponent(), YACS::ENGINE::Proc::componentInstanceMap, YACS::HMI::GuiContext::getCurrent(), and YACS::HMI::GuiContext::getProc().

Referenced by loadProc().

◆ loadContainers()

void SubjectProc::loadContainers ( )

loadContainers is used when an existing scheme has been loaded in memory, to create subjects for containers stored in the schema file, but are not associated with components.

Definition at line 1897 of file guiObservers.cxx.

1898{
1899 Proc* aProc = GuiContext::getCurrent()->getProc();
1900 for (map<string, Container*>::const_iterator itCont = aProc->containerMap.begin(); itCont != aProc->containerMap.end(); ++itCont)
1901 if ( GuiContext::getCurrent()->_mapOfSubjectContainer.find((*itCont).second) == GuiContext::getCurrent()->_mapOfSubjectContainer.end() )
1902 // engine object for container already exists => add only a subject for it
1903 addSubjectContainer((*itCont).second,(*itCont).second->getName());
1904}
std::map< std::string, Container * > containerMap
Definition: Proc.hxx:91
SubjectContainerBase * addSubjectContainer(YACS::ENGINE::Container *cont, std::string name="")

References YACS::HMI::GuiContext::_mapOfSubjectContainer, addSubjectContainer(), YACS::ENGINE::Proc::containerMap, YACS::HMI::GuiContext::getCurrent(), and YACS::HMI::GuiContext::getProc().

Referenced by loadProc().

◆ loadProc()

void SubjectProc::loadProc ( )

◆ loadTypes()

void SubjectProc::loadTypes ( )

Load types for a SubjectProc.

This method loads (on import or on creation) all types of the builtin catalog and all types defined in the Proc

Definition at line 1854 of file guiObservers.cxx.

1855{
1856 Catalog* builtinCatalog = getSALOMERuntime()->getBuiltinCatalog();
1857 std::map<std::string, TypeCode *>::iterator pt;
1858 for(pt=builtinCatalog->_typeMap.begin();pt!=builtinCatalog->_typeMap.end();pt++)
1859 {
1860 addSubjectDataType((*pt).second , (*pt).first);
1861 }
1862 for(pt=_proc->typeMap.begin();pt!=_proc->typeMap.end();pt++)
1863 {
1864 addSubjectDataType((*pt).second , (*pt).first);
1865 }
1866}
std::map< std::string, TypeCode * > _typeMap
Definition: Catalog.hxx:49
Catalog * getBuiltinCatalog()
Get the catalog of base nodes (elementary and composed)
Definition: Runtime.cxx:314
YACSRUNTIMESALOME_EXPORT RuntimeSALOME * getSALOMERuntime()

References _proc, YACS::ENGINE::Catalog::_typeMap, addSubjectDataType(), YACS::ENGINE::Runtime::getBuiltinCatalog(), YACS::ENGINE::getSALOMERuntime(), and YACS::ENGINE::Proc::typeMap.

Referenced by loadProc().

◆ localclean()

void SubjectProc::localclean ( Command command = 0)

Definition at line 1824 of file guiObservers.cxx.

1825{
1826 DEBTRACE("SubjectProc::localClean ");
1827}

References DEBTRACE.

Referenced by clean().

◆ removeSubjectContainer()

void SubjectProc::removeSubjectContainer ( SubjectContainerBase scont)

Definition at line 2049 of file guiObservers.cxx.

2050{
2051 YASSERT(GuiContext::getCurrent()->_mapOfSubjectContainer.count(scont->getContainer()));
2052 erase(scont); // do all the necessary updates
2053}
#define YASSERT(val)
YASSERT macro is always defined, used like assert, but throw a YACS::Exception instead of abort.
Definition: YacsTrace.hxx:59
virtual YACS::ENGINE::Container * getContainer() const

References YACS::HMI::Subject::erase(), YACS::HMI::SubjectContainerBase::getContainer(), YACS::HMI::GuiContext::getCurrent(), and YASSERT.

Referenced by YACS::HMI::CommandAddContainerBase::localReverse().

◆ removeSubjectDataType()

void SubjectProc::removeSubjectDataType ( std::string  typeName)

Definition at line 2034 of file guiObservers.cxx.

2035{
2036 Proc* proc = GuiContext::getCurrent()->getProc();
2037 YASSERT(proc->typeMap.count(typeName));
2038 YASSERT(GuiContext::getCurrent()->_mapOfSubjectDataType.count(typeName));
2039 TypeCode* aTypeCode = proc->typeMap[typeName];
2041 unsigned int aRefCnt = aTypeCode->getRefCnt();
2042 DEBTRACE("SubjectProc::removeSubjectDataType: " << typeName << " " << aRefCnt);
2044 proc->typeMap.erase(typeName);
2045 erase(aSDataType); // do all the necessary updates
2046 aTypeCode->decrRef();
2047}
unsigned int getRefCnt() const
Definition: RefCounter.hxx:32
Base class for all type objects.
Definition: TypeCode.hxx:68

References YACS::HMI::GuiContext::_mapOfSubjectDataType, DEBTRACE, YACS::ENGINE::RefCounter::decrRef(), YACS::HMI::Subject::erase(), YACS::HMI::GuiContext::getCurrent(), YACS::HMI::GuiContext::getProc(), YACS::ENGINE::RefCounter::getRefCnt(), YACS::ENGINE::Proc::typeMap, and YASSERT.

Referenced by YACS::HMI::CommandAddDataTypeFromCatalog::localReverse().

Member Data Documentation

◆ _postEraseList

std::vector<Subject*> YACS::HMI::SubjectProc::_postEraseList
protected

Definition at line 533 of file guiObservers.hxx.

Referenced by addPostErase(), cleanPostErase(), and SubjectProc().

◆ _proc

YACS::ENGINE::Proc* YACS::HMI::SubjectProc::_proc
protected

Definition at line 532 of file guiObservers.hxx.

Referenced by loadTypes().


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