CernVM-FS  2.12.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Future< T > Class Template Reference

#include <future.h>

Inheritance diagram for Future< T >:
Collaboration diagram for Future< T >:

Public Member Functions

 Future ()
 
 ~Future ()
 
void Set (const T &object)
 
T & Get ()
 
const T & Get () const
 

Private Member Functions

void Wait () const
 
- Private Member Functions inherited from SingleCopy
 SingleCopy ()
 

Private Attributes

object_
 
pthread_mutex_t mutex_
 
pthread_cond_t object_set_
 
bool object_was_set_
 

Detailed Description

template<typename T>
class Future< T >

This file is part of the CernVM File System. This is a simple implementation of a Future wrapper template. It is used as a proxy for results that are computed asynchronously and might not be available on the first access. Since this is a very simple implementation one needs to use the Future's Get() and Set() methods to obtain the containing data resp. to write it. Note: More than a single call to Set() is prohibited! If Get() is called before Set() the calling thread will block until the value has been set by a different thread.

Parameters
Tthe value type wrapped by this Future template

Definition at line 32 of file future.h.

Constructor & Destructor Documentation

template<typename T>
Future< T >::Future ( )
inline

Definition at line 34 of file future.h.

template<typename T>
Future< T >::~Future ( )
inline

Definition at line 41 of file future.h.

Member Function Documentation

template<typename T>
const T& Future< T >::Get ( ) const
inline

Definition at line 71 of file future.h.

template<typename T>
void Future< T >::Wait ( ) const
inlineprivate

Definition at line 77 of file future.h.

Member Data Documentation

template<typename T>
pthread_mutex_t Future< T >::mutex_
mutableprivate

Definition at line 85 of file future.h.

template<typename T>
T Future< T >::object_
private

Definition at line 84 of file future.h.

template<typename T>
pthread_cond_t Future< T >::object_set_
mutableprivate

Definition at line 86 of file future.h.

template<typename T>
bool Future< T >::object_was_set_
private

Definition at line 87 of file future.h.


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