GraphLab: Distributed Graph-Parallel API  2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
graphlab::blob Class Reference

#include <graphlab/util/generics/blob.hpp>

List of all members.

Public Member Functions

 blob ()
 user information
 blob (size_t new_size)
 blob (size_t osize, void *odata)
 blob (const blob &b)
template<typename T >
T & as ()
template<typename T >
const T & as () const
template<typename T >
T * as_ptr ()
template<typename T >
const T * as_ptr () const
size_t size () const
void * data ()
const void * data () const
bloboperator= (const blob &b)
void copy (size_t osize, void *odata)
void copy (const blob &other)
blob copy () const
void resize (size_t new_size)
void clear ()
void swap (blob &b)
void load (iarchive &arc)
void save (oarchive &arc) const

Detailed Description

blob is the general representation of a "block" of information. . 'data' must be exactly 'length' bytes and must be entirely self contained. It must not hold references to other memory regions. That is to say, I should be able read off exactly 'length' bytes from 'data', and send it across a network/write it to a disk/etc, and the information should still be consistent The blob is self-managed and will free and delete the underlying memory when it goes out of scope.

Definition at line 47 of file blob.hpp.


Constructor & Destructor Documentation

graphlab::blob::blob ( )
inline

user information

Create an empty blob

Definition at line 53 of file blob.hpp.

graphlab::blob::blob ( size_t  new_size)
inline

Create simple blob of a certain size (with allocation)

Definition at line 56 of file blob.hpp.

graphlab::blob::blob ( size_t  osize,
void *  odata 
)
inline

Makes a copy of the ptr provided

Definition at line 62 of file blob.hpp.

graphlab::blob::blob ( const blob b)
inline

Copy constructor

Definition at line 67 of file blob.hpp.


Member Function Documentation

template<typename T >
T& graphlab::blob::as ( )
inline

Smart Casting

Definition at line 77 of file blob.hpp.

template<typename T >
const T& graphlab::blob::as ( ) const
inline

Smart Casting

Definition at line 85 of file blob.hpp.

template<typename T >
T* graphlab::blob::as_ptr ( )
inline

Smart Casting

Definition at line 93 of file blob.hpp.

template<typename T >
const T* graphlab::blob::as_ptr ( ) const
inline

Smart Casting

Definition at line 101 of file blob.hpp.

void graphlab::blob::clear ( )
inline

free the memory associated with this blob

Definition at line 164 of file blob.hpp.

void graphlab::blob::copy ( size_t  osize,
void *  odata 
)
inline

make a copy of the data passed in as arguments.

Definition at line 126 of file blob.hpp.

void graphlab::blob::copy ( const blob other)
inline

Make "deep" copy of the blob by replicate its binary data

Definition at line 133 of file blob.hpp.

blob graphlab::blob::copy ( ) const
inline

deprecated. Just use operator=

Definition at line 142 of file blob.hpp.

void* graphlab::blob::data ( )
inline

Get the size of the blob

Definition at line 111 of file blob.hpp.

const void* graphlab::blob::data ( ) const
inline

Get the size of the blob

Definition at line 114 of file blob.hpp.

void graphlab::blob::resize ( size_t  new_size)
inline

Resize the blob to any size including 0

Definition at line 146 of file blob.hpp.

size_t graphlab::blob::size ( ) const
inline

Get the size of the blob

Definition at line 108 of file blob.hpp.

void graphlab::blob::swap ( blob b)
inline

Swaps the contents of two blobs. A "safe" version of a shallow copy

Definition at line 175 of file blob.hpp.


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