opensurgsim
SerializationMockComponent.h
1 // This file is a part of the OpenSurgSim project.
2 // Copyright 2013, SimQuest Solutions Inc.
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 #ifndef SURGSIM_TESTING_SERIALIZATIONMOCKCOMPONENT_H
17 #define SURGSIM_TESTING_SERIALIZATIONMOCKCOMPONENT_H
18 
19 #include "SurgSim/Framework/Component.h"
20 #include "SurgSim/Framework/ObjectFactory.h"
21 
22 SURGSIM_STATIC_REGISTRATION(SerializationMockComponent);
23 
28 {
29 public:
30  explicit SerializationMockComponent(const std::string& name, bool succeedInit = true, bool succeedWakeUp = true);
31 
32  virtual ~SerializationMockComponent();
33 
34  SURGSIM_CLASSNAME(SerializationMockComponent);
35 
36  virtual bool doInitialize();
37  virtual bool doWakeUp();
38 
39  bool getSucceedWithInit() const;
40  void setSucceedWithInit(bool val);
41 
42  bool getSucceedWithWakeUp() const;
43  void setSucceedWithWakeUp(bool val);
44 
45  bool succeedWithInit;
46  bool succeedWithWakeUp;
47  bool didWakeUp;
48  bool didInit;
49 };
50 
51 #endif // SURGSIM_TESTING_SERIALIZATIONMOCKCOMPONENT_H
virtual bool doWakeUp()
Interface to be implemented by derived classes.
Definition: SerializationMockComponent.cpp:47
Component is the main interface class to pass information to the system managers each will decide whe...
Definition: Component.h:42
This class is for testing the linker and checking if the definition stays in the executable even if t...
Definition: SerializationMockComponent.h:27
virtual bool doInitialize()
Interface to be implemented by derived classes.
Definition: SerializationMockComponent.cpp:41