25 #ifndef INCLUDED_GenerateCompoundServer_h_GUID_55F870FA_C398_49B8_9907_A007B3C6F8CA 26 #define INCLUDED_GenerateCompoundServer_h_GUID_55F870FA_C398_49B8_9907_A007B3C6F8CA 32 #include <boost/mpl/begin_end.hpp> 33 #include <boost/mpl/deref.hpp> 34 #include <boost/mpl/next.hpp> 35 #include <boost/type_traits/is_same.hpp> 41 namespace connection {
42 namespace server_generation {
49 template <
typename Iter>
51 : boost::is_same<typename boost::mpl::next<Iter>::type,
52 typename boost::mpl::end<Types>::type> {};
55 template <typename Iter = typename boost::mpl::begin<Types>::type,
61 typedef typename boost::mpl::deref<Iter>::type
type;
73 template <
typename Iter>
76 typedef typename LeafBase<Iter>::type MyLeafBase;
79 void mainloop() { MyLeafBase::server_mainloop(); }
80 vrpn_Connection *connectionPtr() {
81 return MyLeafBase::connectionPtr();
87 template <
typename Iter>
91 typedef typename LeafBase<Iter>::type MyLeafBase;
96 : MyLeafBase(init), MyChainBase(init) {}
99 void mainloop() { MyLeafBase::server_mainloop(); }
101 vrpn_Connection *connectionPtr() {
102 return MyLeafBase::connectionPtr();
111 return new type(init);
118 #endif // INCLUDED_GenerateCompoundServer_h_GUID_55F870FA_C398_49B8_9907_A007B3C6F8CA void mainloop()
Mainloop calls server_mainloop in the leaf.
Definition: GenerateCompoundServer.h:99
The main namespace for all C++ elements of the framework, internal and external.
Definition: namespace_osvr.dox:3
Compute base class: the recursive step to the next element in the sequence.
Definition: GenerateCompoundServer.h:66
static type * make(ConstructorArgument &init)
Create a server.
Definition: GenerateCompoundServer.h:110
Definition: GenerateCompoundServer.h:50
Compute base class: the current class from the sequence.
Definition: GenerateCompoundServer.h:60
ServerElement(ConstructorArgument &init)
Constructor passing along.
Definition: GenerateCompoundServer.h:78
ServerElement(ConstructorArgument &init)
Constructor passing along to both base classes.
Definition: GenerateCompoundServer.h:95
Definition: DeviceConstructionData.h:41
Forward declare the main class.
Definition: GenerateCompoundServer.h:57
Metaprogramming to generate a VRPN server object out of an MPL sequence of types. ...
Definition: GenerateCompoundServer.h:47
ServerElement type
Computed server type.
Definition: GenerateCompoundServer.h:107