OSVR-Core
Public Types | Public Member Functions | Protected Member Functions | List of all members
osvr::common::elements::ElementBase< Type > Class Template Reference

Base, using the CRTP, providing some basic functionality for path elements. More...

#include <PathElementTypes.h>

Inheritance diagram for osvr::common::elements::ElementBase< Type >:
osvr::common::elements::EmptyElementBase< Type >

Public Types

typedef Type type
 
typedef ElementBase< Type > base_type
 

Public Member Functions

const char * getTypeName () const
 

Protected Member Functions

 ElementBase ()
 Protected constructor to force subclassing. More...
 

Detailed Description

template<typename Type>
class osvr::common::elements::ElementBase< Type >

Base, using the CRTP, providing some basic functionality for path elements.

Constructor & Destructor Documentation

§ ElementBase()

template<typename Type >
osvr::common::elements::ElementBase< Type >::ElementBase ( )
inlineprotected

Protected constructor to force subclassing.

This inline implementation MUST remain at the bottom of this file, after all full declarations of types to be included in PathElement.

Inline implementation at the bottom of the file contains static assertions.

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 ElementBase<X>, there exists a class X : public ElementBase<X> {}; Doesn't prevent inheriting from the wrong base (class X : public ElementBase<Y> {}; where there is already a class Y : public ElementBase<Y> {}; - we have a static assert in the .cpp file to handle that for the types in the PathElement type list.

Enforce that every element type (that gets instantiated) has to be holdable by the PathElement variant


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