TBTK
StateSet.h
Go to the documentation of this file.
1 /* Copyright 2016 Kristofer Bj√∂rnson
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
23 #ifndef COM_DAFER45_TBTK_STATE_SET
24 #define COM_DAFER45_TBTK_STATE_SET
25 
26 #include "TBTK/AbstractState.h"
27 
28 namespace TBTK{
29 
30 class StateSet{
31 public:
37  StateSet(bool isOwner = true);
38 
40  ~StateSet();
41 
44  void addState(AbstractState *state);
45 
47  const std::vector<AbstractState*>& getStates() const;
48 
50  unsigned int getNumStates() const;
51 private:
53  std::vector<AbstractState*> states;
54 
56  bool isOwner;
57 };
58 
59 inline void StateSet::addState(AbstractState *state){
60  states.push_back(state);
61 }
62 
63 inline const std::vector<AbstractState*>& StateSet::getStates() const{
64  return states;
65 }
66 
67 inline unsigned int StateSet::getNumStates() const{
68  return states.size();
69 }
70 
71 }; //End of namespace TBTK
72 
73 #endif
Abstract state class from which other states inherit.
Definition: AbstractState.h:37
Definition: ModelFactory.h:35
StateSet(bool isOwner=true)
const std::vector< AbstractState * > & getStates() const
Definition: StateSet.h:63
void addState(AbstractState *state)
Definition: StateSet.h:59
Definition: StateSet.h:30
unsigned int getNumStates() const
Definition: StateSet.h:67