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 "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 private:
50  std::vector<AbstractState*> states;
51 
53  bool isOwner;
54 };
55 
56 inline void StateSet::addState(AbstractState *state){
57  states.push_back(state);
58 }
59 
60 inline const std::vector<AbstractState*>& StateSet::getStates() const{
61  return states;
62 }
63 
64 }; //End of namespace TBTK
65 
66 #endif
Abstract state class from which other states inherit.
~StateSet()
Definition: StateSet.cpp:31
Definition: AbstractState.h:37
Definition: AbstractOperator.h:26
StateSet(bool isOwner=true)
Definition: StateSet.cpp:27
const std::vector< AbstractState * > & getStates() const
Definition: StateSet.h:60
void addState(AbstractState *state)
Definition: StateSet.h:56
Definition: StateSet.h:30