OSVR-Core
NetworkingSupport.h
Go to the documentation of this file.
1 
11 // Copyright 2015 Sensics, Inc.
12 //
13 // Licensed under the Apache License, Version 2.0 (the "License");
14 // you may not use this file except in compliance with the License.
15 // You may obtain a copy of the License at
16 //
17 // http://www.apache.org/licenses/LICENSE-2.0
18 //
19 // Unless required by applicable law or agreed to in writing, software
20 // distributed under the License is distributed on an "AS IS" BASIS,
21 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22 // See the License for the specific language governing permissions and
23 // limitations under the License.
24 
25 #ifndef INCLUDED_NetworkingSupport_h_GUID_A5FE2D05_48DC_469E_1013_F2B7736331F3
26 #define INCLUDED_NetworkingSupport_h_GUID_A5FE2D05_48DC_469E_1013_F2B7736331F3
27 
28 // Internal Includes
29 #include <osvr/Common/Export.h>
30 
31 // Library/third-party includes
32 #include <boost/noncopyable.hpp>
33 
34 // Standard includes
35 #include <string>
36 
37 namespace osvr {
38 namespace common {
43  class NetworkingSupport : boost::noncopyable {
44  public:
46  OSVR_COMMON_EXPORT NetworkingSupport();
47 
49  OSVR_COMMON_EXPORT ~NetworkingSupport();
50 
52  bool isUp() const { return m_up; }
53 
56  bool wasSuccessful() const { return m_success; }
57 
59  std::string const &getError() const { return m_err; }
60 
62  void shutdown();
63 
64  private:
67  bool m_start();
70  bool m_stop();
71  bool m_up;
72  bool m_success;
73  std::string m_err;
74  };
75 } // namespace common
76 } // namespace osvr
77 
78 #endif // INCLUDED_NetworkingSupport_h_GUID_A5FE2D05_48DC_469E_1013_F2B7736331F3
std::string const & getError() const
Get error message, if any.
Definition: NetworkingSupport.h:59
Handles spatial transformations.
Definition: SerializationTraitExample_Complicated.h:40
bool wasSuccessful() const
Get whether the last operation (automatic startup or manual, early shutdown) was successful.
Definition: NetworkingSupport.h:56
The main namespace for all C++ elements of the framework, internal and external.
Definition: namespace_osvr.dox:3
bool isUp() const
Get whether the networking system is successfully "up".
Definition: NetworkingSupport.h:52
OSVR_COMMON_EXPORT ~NetworkingSupport()
Destructor.
Definition: NetworkingSupport.cpp:88
RAII class wrapping networking system startup.
Definition: NetworkingSupport.h:43
void shutdown()
Shutdown before destruction.
Definition: NetworkingSupport.cpp:95
OSVR_COMMON_EXPORT NetworkingSupport()
Constructor.
Definition: NetworkingSupport.cpp:84