OSVR Framework (Internal Development Docs)  0.6-1962-g59773924
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
GraphOutputInterface.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_GraphOutputInterface_h_GUID_CA9DFEEF_13CD_41BB_B5AF_377C61EE81A6
26 #define INCLUDED_GraphOutputInterface_h_GUID_CA9DFEEF_13CD_41BB_B5AF_377C61EE81A6
27 
28 // Internal Includes
29 #include <osvr/Util/UniquePtr.h>
30 
31 // Library/third-party includes
32 #include <boost/noncopyable.hpp>
33 
34 // Standard includes
35 #include <string>
36 #include <iosfwd>
37 
38 class NodeInterface : boost::noncopyable {
39  public:
40  virtual std::string const &getID() const = 0;
41 
42  protected:
43  NodeInterface() = default;
44 };
45 class GraphOutputInterface : boost::noncopyable {
46  public:
48  static osvr::unique_ptr<GraphOutputInterface>
49  createGraphOutputInterface(std::ostream &os, std::string const &type);
50 
51  virtual ~GraphOutputInterface();
52 
53  virtual NodeInterface &addNode(std::string const &label,
54  std::string const &fullPath,
55  std::string const &type) = 0;
56  virtual NodeInterface &getNode(std::string const &fullPath) = 0;
57  virtual void addEdge(NodeInterface &tail, NodeInterface &head,
58  std::string const &type,
59  std::string const &data = std::string()) = 0;
62  virtual void enableTreeOrganization() = 0;
63 
64  protected:
65  GraphOutputInterface() = default;
66 };
67 
68 #endif // INCLUDED_GraphOutputInterface_h_GUID_CA9DFEEF_13CD_41BB_B5AF_377C61EE81A6
virtual void enableTreeOrganization()=0
Sets a flag indicating that we should try to organize nodes in the path tree structure.
typename detail::split_list_< List...>::head head
Get the first element of a list.
Definition: SplitList.h:54
typename detail::split_list_< List...>::tail tail
Get the list without its first element.
Definition: SplitList.h:58
Header to bring unique_ptr into the osvr namespace.
static osvr::unique_ptr< GraphOutputInterface > createGraphOutputInterface(std::ostream &os, std::string const &type)
Factory method.