COPASI API  4.16.103
CLStyle.h
Go to the documentation of this file.
1 // Begin CVS Header
2 // $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/layout/CLStyle.h,v $
3 // $Revision: 1.4 $
4 // $Name: $
5 // $Author: shoops $
6 // $Date: 2011/09/30 16:35:20 $
7 // End CVS Header
8 
9 // Copyright (C) 2011 - 2010 by Pedro Mendes, Virginia Tech Intellectual
10 // Properties, Inc., University of Heidelberg, and The University
11 // of Manchester.
12 // All rights reserved.
13 
14 #ifndef CLStyle_H__
15 #define CLStyle_H__
16 
17 #include <set>
18 #include <string>
19 
20 #include "copasi/layout/CLBase.h"
21 #include "copasi/layout/CLGroup.h"
22 
24 
25 class Style;
26 
27 class CLStyle : public CLBase, public CCopasiContainer
28 {
29 private:
30  // prevent the compiler from generating the assignment operator
31  CLStyle& operator=(const CLStyle& source);
32 
33 protected:
34  std::set<std::string> mRoleList;
35  std::set<std::string> mTypeList;
37 
38  /**
39  * key string for the style.
40  */
41  std::string mKey;
42 
43 public:
44  /**
45  * Constructor.
46  */
47  CLStyle(const std::string& name, CCopasiContainer* pParent = NULL);
48 
49  /**
50  * Copy Constructor.
51  */
52  CLStyle(const CLStyle& source, CCopasiContainer* pParent = NULL);
53 
54  /**
55  * Constructor to generate object from the corresponding SBML object.
56  */
57  CLStyle(const Style& source, const std::string& name, CCopasiContainer* pParent = NULL);
58 
59  /**
60  * Destructor
61  */
62  ~CLStyle();
63 
64  /**
65  * Sets the group.
66  */
67  void setGroup(const CLGroup* pGroup);
68 
69  /**
70  * Returns the group.
71  */
72  const CLGroup* getGroup() const;
73 
74  /**
75  * Returns the group.
76  */
77  CLGroup* getGroup();
78 
79  /**
80  * Returns the number of roles in the role list.
81  */
82  size_t getNumRoles() const;
83 
84  /**
85  * Adds an role to the role list.
86  */
87  void addRole(const std::string& role);
88 
89  /**
90  * Checks whether a given role is in the role list.
91  */
92  bool isInRoleList(const std::string& role) const;
93 
94  /**
95  * Removes a role from the role list.
96  */
97  void removeRole(const std::string& role);
98 
99  /**
100  * Sets the role list.
101  */
102  void setRoleList(const std::set<std::string>& roleList);
103 
104  /**
105  * Returns the role list.
106  */
107  const std::set<std::string>& getRoleList() const;
108 
109  /**
110  * Returns the type list.
111  */
112  const std::set<std::string>& getTypeList() const;
113 
114  /**
115  * Sets the type list.
116  */
117  void setTypeList(const std::set<std::string>& typeList);
118 
119  /**
120  * Returns the number of types in the type list.
121  */
122  size_t getNumTypes() const;
123 
124  /**
125  * Adds a type to the type list.
126  */
127  void addType(const std::string& type);
128 
129  /**
130  * Checks whether a given type is in the type list.
131  */
132  bool isInTypeList(const std::string& type) const;
133 
134  /**
135  * Removes an type from the type list.
136  */
137  void removeType(const std::string& type);
138 
139  static void readIntoSet(const std::string& s, std::set<std::string>& set);
140 
141  static std::string createStringFromSet(const std::set<std::string>& set);
142 
143  /**
144  * Returns the key of the style
145  */
146  const std::string& getKey() const;
147 
148  /**
149  * Adds the attributes for a style object to the passed in.
150  * object.
151  */
152  void addSBMLAttributes(Style* pStyle) const;
153 };
154 
155 #endif /* CLStyle_H__ */
size_t getNumTypes() const
Definition: CLStyle.cpp:139
void removeType(const std::string &type)
Definition: CLStyle.cpp:163
void removeRole(const std::string &role)
Definition: CLStyle.cpp:131
~CLStyle()
Definition: CLStyle.cpp:67
void setGroup(const CLGroup *pGroup)
Definition: CLStyle.cpp:75
void addRole(const std::string &role)
Definition: CLStyle.cpp:115
CLStyle & operator=(const CLStyle &source)
static void readIntoSet(const std::string &s, std::set< std::string > &set)
Definition: CLStyle.cpp:168
void addType(const std::string &type)
Definition: CLStyle.cpp:147
std::string mKey
Definition: CLStyle.h:41
CLGroup * mpGroup
Definition: CLStyle.h:36
const std::set< std::string > & getRoleList() const
Definition: CLStyle.cpp:201
size_t getNumRoles() const
Definition: CLStyle.cpp:107
const std::set< std::string > & getTypeList() const
Definition: CLStyle.cpp:206
std::set< std::string > mTypeList
Definition: CLStyle.h:35
const CLGroup * getGroup() const
Definition: CLStyle.cpp:91
void addSBMLAttributes(Style *pStyle) const
Definition: CLStyle.cpp:237
Definition: CLBase.h:33
void setTypeList(const std::set< std::string > &typeList)
Definition: CLStyle.cpp:218
Header file of class CCopasiContainer.
const std::string & getKey() const
Definition: CLStyle.cpp:228
CLStyle(const std::string &name, CCopasiContainer *pParent=NULL)
Definition: CLStyle.cpp:26
bool isInTypeList(const std::string &type) const
Definition: CLStyle.cpp:155
static std::string createStringFromSet(const std::set< std::string > &set)
Definition: CLStyle.cpp:182
bool isInRoleList(const std::string &role) const
Definition: CLStyle.cpp:123
std::set< std::string > mRoleList
Definition: CLStyle.h:34
void setRoleList(const std::set< std::string > &roleList)
Definition: CLStyle.cpp:211