OGLplus (0.52.0) a C++ wrapper for OpenGL

oglplus::OptionalImpl< tag::Object, Object > Class Template Reference

Modifier that allows to create uninitialized Object(s) More...

#include </home/chochlik/devel/oglplus/include/oglplus/object/optional.hpp>

Inherits oglplus::Object< ObjectOps >.

Public Member Functions

 OptionalImpl (void)
 Construction of an uninitialized instance. More...
 
 OptionalImpl (Object &&temp)
 Construction of an initialized instance. More...
 
 OptionalImpl (OptionalImpl &&temp)
 Move constructor.
 
bool IsInitialized (void) const
 Returns true if the object is initialized, false otherwise. More...
 
Object Release (void)
 Releases the stored object and makes this Optional uninitialized.
 

Detailed Description

template<class Object>
class oglplus::OptionalImpl< tag::Object, Object >

Modifier that allows to create uninitialized Object(s)

The Optional template class is a modifier for Objects and in contrast to Objects it does allow to construct uninitialized instances which can be initialized later.

An Optional<Object> can be used everywhere an Object could be used, but it must be initialized (the IsInitialized() member function must return true), otherwise usage results in undefined behavior.

Constructor & Destructor Documentation

template<class Object >
oglplus::OptionalImpl< tag::Object, Object >::OptionalImpl ( void  )

Construction of an uninitialized instance.

The only things that can safely be done with an uninitialized Optional<Object> is assignment, moving, destruction and checking whether it is initialized.

See Also
IsInitialized
Assign
template<class Object >
oglplus::OptionalImpl< tag::Object, Object >::OptionalImpl ( Object &&  temp)

Construction of an initialized instance.

Initialized Optional<Object> can be used everywhere where a plain Object could be used, furthermore Optional<Object> can also be cleared (this brings it in uninitialized state)

See Also
IsInitialized
Clear

Member Function Documentation

template<class Object >
bool oglplus::OptionalImpl< tag::Object, Object >::IsInitialized ( void  ) const

Returns true if the object is initialized, false otherwise.

The only things that can safely be done with an uninitialized Optional<Object> is assignment, moving, destruction and checking whether it is initialized. On the other hand initialized Optional<Object> can be used everywhere where a plain Object could be used.

See Also
Release

The documentation for this class was generated from the following file:
  • /home/chochlik/devel/oglplus/include/oglplus/object/optional.hpp

Copyright © 2010-2014 Matúš Chochlík, University of Žilina, Žilina, Slovakia.
<matus.chochlik -at- fri.uniza.sk>
<chochlik -at -gmail.com>
Documentation generated on Mon Sep 22 2014 by Doxygen (version 1.8.6).