modeExecutor.h
Go to the documentation of this file.
1 /*
2  * Copyright 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA)
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9 
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 
18 #ifndef MODEEXECUTOR_H
19 #define MODEEXECUTOR_H
20 
21 #include <mode.h>
22 #include <iColorO.h>
23 #include <modeFactory.h>
24 #include <boost/thread.hpp>
25 #include <boost/lambda/bind.hpp>
26 #include <map>
27 
29 {
30 public:
31  ModeExecutor(IColorO* colorO);
32  ~ModeExecutor();
33 
34  uint64_t execute(boost::shared_ptr<Mode> mode);
35  uint64_t execute(cob_light::LightMode requestMode);
36 
38  int getExecutingMode();
39  uint64_t getExecutingUId();
40 
41  void pause();
42  void resume();
43  void stop();
44  bool stop(uint64_t uId);
45 
46  void setDefaultPriority(int priority);
47 
48 private:
50 
52  std::map<int, boost::shared_ptr<Mode>, std::greater<int> > _mapActiveModes;
54 
57 
58  void onModeFinishedReceived(int prio);
60 };
61 
62 #endif
bool _stopRequested
Definition: modeExecutor.h:55
void onColorSetReceived(color::rgba color)
void setDefaultPriority(int priority)
int default_priority
Definition: modeExecutor.h:56
std::map< int, boost::shared_ptr< Mode >, std::greater< int > > _mapActiveModes
Definition: modeExecutor.h:52
int getExecutingPriority()
ModeExecutor(IColorO *colorO)
int getExecutingMode()
IColorO * _colorO
Definition: modeExecutor.h:49
uint64_t execute(boost::shared_ptr< Mode > mode)
void onModeFinishedReceived(int prio)
color::rgba _activeColor
Definition: modeExecutor.h:53
uint64_t getExecutingUId()
boost::shared_ptr< Mode > _activeMode
Definition: modeExecutor.h:51


cob_light
Author(s): Benjamin Maidel
autogenerated on Wed Apr 7 2021 02:11:39