Sequence Chart Studio  svn HEAD revision
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Private Attributes | List of all members
SessionAttribute< Type > Class Template Reference

#include <session_attribute.h>

Inheritance diagram for SessionAttribute< Type >:
Inheritance graph
Collaboration diagram for SessionAttribute< Type >:
Collaboration graph

Public Member Functions

 SessionAttribute (const std::string name, const Type &def)
 default value to set if attribute isnt set More...
 
 ~SessionAttribute ()
 
const std::string get_name ()
 
Type & get (MscElement *e, const Type &def)
 
Type & get (MscElement *e)
 
void set (MscElement *e, const Type &attribute)
 
void clean_up ()
 

Private Attributes

std::stack< MscElementPtrm_elements
 
const Type m_def
 stack of MscElements with set attribute More...
 

Additional Inherited Members

- Protected Member Functions inherited from SA
void reserve_attribute ()
 insert attribute in to the set, throw exception, if there is already one with the same name More...
 
void cancel_attribute ()
 remove attribute from the set of used attribute More...
 
 SA (std::string name)
 
virtual ~SA ()
 
- Protected Attributes inherited from SA
const std::string m_name
 name of attribute More...
 
- Static Protected Attributes inherited from SA
static std::set< std::stringRESERVED_ATTR
 static set that keeps attributes in use More...
 

Detailed Description

template<class Type>
class SessionAttribute< Type >

Definition at line 59 of file session_attribute.h.

Constructor & Destructor Documentation

template<class Type>
SessionAttribute< Type >::SessionAttribute ( const std::string  name,
const Type &  def 
)
inline

default value to set if attribute isnt set

Parameters
nameis name for new atrribute
defis default value for attribute

Definition at line 71 of file session_attribute.h.

template<class Type>
SessionAttribute< Type >::~SessionAttribute ( )
inline

Definition at line 75 of file session_attribute.h.

Member Function Documentation

template<class Type>
void SessionAttribute< Type >::clean_up ( )
inline

Cleaning funtion, removes set attributes from the MscElements

Definition at line 141 of file session_attribute.h.

Referenced by AllPaths::~AllPaths(), and SessionAttribute< std::list< Msc * > >::~SessionAttribute().

template<class Type>
Type& SessionAttribute< Type >::get ( MscElement e,
const Type &  def 
)
inline

Gets atrribute m_name from the MscElement e, if the attribute m_name isnt set, default value def is used to set attribute

Parameters
eis MscElement to get attribute from
defis value to set if the attribute isnt set

Definition at line 97 of file session_attribute.h.

Referenced by DFSHMscsTraverse::add_parent(), AllPaths::get_number(), DFSHMscsTraverse::get_parents(), and AllPaths::set_number().

template<class Type>
Type& SessionAttribute< Type >::get ( MscElement e)
inline

Gets atrribute m_name from the MscElement e, if the attribute m_name isnt set, default value m_def is used to set attribute

Parameters
eis MscElement to get attribute from

Definition at line 114 of file session_attribute.h.

template<class Type>
const std::string SessionAttribute< Type >::get_name ( )
inline

Definition at line 85 of file session_attribute.h.

template<class Type>
void SessionAttribute< Type >::set ( MscElement e,
const Type &  attribute 
)
inline

Set attribute m_name with value attribute to the MscElement e

Parameters
eMscElement
attributeto set to MscElement MscElements could are inserted to the stack EVERY TIME attribute is set.

WARNING

Definition at line 132 of file session_attribute.h.

Referenced by AllPaths::set_number().

Member Data Documentation

template<class Type>
const Type SessionAttribute< Type >::m_def
private

stack of MscElements with set attribute

Definition at line 64 of file session_attribute.h.

Referenced by SessionAttribute< std::list< Msc * > >::get().

template<class Type>
std::stack<MscElementPtr> SessionAttribute< Type >::m_elements
private

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

SourceForge.net Logo
Generated on Fri Jan 15 2016 16:26:59 for Sequence Chart Studio by  doxygen