TBTK
Need a break? Support the development by playing Polarity Puzzles
StateSet.h
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 
17 
24 #ifndef COM_DAFER45_TBTK_STATE_SET
25 #define COM_DAFER45_TBTK_STATE_SET
26 
27 #include "TBTK/AbstractState.h"
28 
29 namespace TBTK{
30 
31 class StateSet{
32 public:
38  StateSet(bool isOwner = true);
39 
41  ~StateSet();
42 
45  void addState(AbstractState *state);
46 
48  const std::vector<AbstractState*>& getStates() const;
49 
51  unsigned int getNumStates() const;
52 private:
54  std::vector<AbstractState*> states;
55 
57  bool isOwner;
58 };
59 
60 inline void StateSet::addState(AbstractState *state){
61  states.push_back(state);
62 }
63 
64 inline const std::vector<AbstractState*>& StateSet::getStates() const{
65  return states;
66 }
67 
68 inline unsigned int StateSet::getNumStates() const{
69  return states.size();
70 }
71 
72 }; //End of namespace TBTK
73 
74 #endif
75 
Definition: Boolean.h:32