OSVR-Core
Public Types | Public Member Functions | List of all members
osvr::common::class_of_service::ClassOfServiceBase< ClassOfService > Struct Template Reference

CRTP base for classes of service, useful for accepting classes of service for an argument without letting just any old type through. More...

#include <NetworkClassOfService.h>

Inheritance diagram for osvr::common::class_of_service::ClassOfServiceBase< ClassOfService >:
osvr::common::class_of_service::detail::ClassOfServiceRoot

Public Types

typedef ClassOfService type
 
typedef ClassOfServiceBase< ClassOfService > base_type
 

Public Member Functions

 ClassOfServiceBase ()
 This inline implementation MUST remain at the bottom of this file. More...
 

Detailed Description

template<typename ClassOfService>
struct osvr::common::class_of_service::ClassOfServiceBase< ClassOfService >

CRTP base for classes of service, useful for accepting classes of service for an argument without letting just any old type through.

Constructor & Destructor Documentation

§ ClassOfServiceBase()

template<typename ClassOfService >
osvr::common::class_of_service::ClassOfServiceBase< ClassOfService >::ClassOfServiceBase ( )
inline

This inline implementation MUST remain at the bottom of this file.

It consists entirely of compile time checks, so it is effectively removed from the code once the conditions are verified.

Partially enforce the Curiously-Recurring Template Pattern. The assertion here is that for some ClassOfServiceBase<X>, there exists a class X : public ClassOfServiceBase<X> {}; Doesn't prevent inheriting from the wrong base (class X : public ClassOfServiceBase<Y> {}; where there is already a class Y : public ClassOfServiceBase<Y> {};)


The documentation for this struct was generated from the following file: