#include <glshared.hpp>
Public Types | |
| typedef void(* | apply_function_type )(any ¤t_data, const any ¶m) |
Public Member Functions | |
| virtual any | get_any () const =0 |
| virtual void | set_any (const any &)=0 |
| virtual void | apply (apply_function_type fun, const any &srcd)=0 |
| virtual bool | is_unique () const =0 |
Common base class for all glshared<T> objects. Exposes a common interface allowing all glshared<T> objects to be manipulated in the same way.
Definition at line 37 of file glshared.hpp.
| typedef void(* graphlab::glshared_base::apply_function_type)(any ¤t_data, const any ¶m) |
The type of an apply function. The apply function performs an atomic operation on the contents of a shared object. The apply function takes a reference to the current value of the object (current_value: wrapped inside an any), an additional parameter (param), and makes modifications to the current value.
Reimplemented in graphlab::distributed_glshared_base, and graphlab::glshared< T >.
Definition at line 47 of file glshared.hpp.
| virtual void graphlab::glshared_base::apply | ( | apply_function_type | fun, | |
| const any & | srcd | |||
| ) | [pure virtual] |
Performs an atomic modification on the value of the shared object. essentially calls fun(current_value, srcd) where current_value is the value of this variable wrapped inside an any.
| virtual any graphlab::glshared_base::get_any | ( | ) | const [pure virtual] |
Gets the value of the shared variable wrapped in an any.
Implemented in graphlab::distributed_glshared_base, and graphlab::glshared< T >.
| virtual bool graphlab::glshared_base::is_unique | ( | ) | const [pure virtual] |
Returns true if there are no other active references to this variable.
Implemented in graphlab::distributed_glshared_base, and graphlab::glshared< T >.
| virtual void graphlab::glshared_base::set_any | ( | const any & | ) | [pure virtual] |
Sets the value of the shared variable using an any. The type of the any must match the type of the shared object.
Implemented in graphlab::distributed_glshared_base, and graphlab::glshared< T >.
1.7.1