Teuchos::RawWorkspace Class Reference
[Set of utilities for allocating temporary workspace.]

Encapulsation object for raw temporary workspace that has been allocated. These objects can only be created on the stack and should not be included as the member of any other classes. More...

#include <Teuchos_Workspace.hpp>

List of all members.

Public Member Functions

 RawWorkspace (WorkspaceStore *workspace_store, size_t num_bytes)
 Allocate num_bytes bytes of temporary workspace. When this object is created if workspace_store != NULL the workspace_store object will be used to get the raw memory. If workspace_store == NULL || workspace_store->num_bytes_remaining() < num_bytes then this memory will have to be dynamically allocated.
 ~RawWorkspace ()
 Deallocate workspace.
size_t num_bytes () const
 Return the number of bytes of raw workspace.
char * workspace_ptr ()
 Give a raw pointer to the beginning of the workspace.
const char * workspace_ptr () const
 

Private Member Functions

 RawWorkspace ()
 RawWorkspace (const RawWorkspace &)
RawWorkspaceoperator= (const RawWorkspace &)

Static Private Member Functions

static void * operator new (size_t)
static void operator delete (void *)

Private Attributes

WorkspaceStoreworkspace_store_
char * workspace_begin_
char * workspace_end_
bool owns_memory_

Friends

class WorkspaceStore
 

Detailed Description

Encapulsation object for raw temporary workspace that has been allocated. These objects can only be created on the stack and should not be included as the member of any other classes.

Definition at line 90 of file Teuchos_Workspace.hpp.


Constructor & Destructor Documentation

Teuchos::RawWorkspace::RawWorkspace ( WorkspaceStore workspace_store,
size_t  num_bytes 
)

Allocate num_bytes bytes of temporary workspace. When this object is created if workspace_store != NULL the workspace_store object will be used to get the raw memory. If workspace_store == NULL || workspace_store->num_bytes_remaining() < num_bytes then this memory will have to be dynamically allocated.

Preconditons:

  • num_bytes >= 0 (throw std::invalid_arguemnt)

Postconditons:

Parameters:
workspace_store [in] Pointer to the workspace object to get the memory from. This can be NULL in which case new T[] and delete [] will be used instead.
num_bytes [in] The number of bytes to allocate.

Definition at line 109 of file Teuchos_Workspace.cpp.

Teuchos::RawWorkspace::~RawWorkspace (  ) 

Deallocate workspace.

Definition at line 141 of file Teuchos_Workspace.cpp.

Teuchos::RawWorkspace::RawWorkspace (  )  [private]
Teuchos::RawWorkspace::RawWorkspace ( const RawWorkspace  )  [private]

Member Function Documentation

size_t Teuchos::RawWorkspace::num_bytes (  )  const [inline]

Return the number of bytes of raw workspace.

Definition at line 509 of file Teuchos_Workspace.hpp.

char * Teuchos::RawWorkspace::workspace_ptr (  )  [inline]

Give a raw pointer to the beginning of the workspace.

Definition at line 515 of file Teuchos_Workspace.hpp.

const char * Teuchos::RawWorkspace::workspace_ptr (  )  const [inline]

Definition at line 521 of file Teuchos_Workspace.hpp.

RawWorkspace& Teuchos::RawWorkspace::operator= ( const RawWorkspace  )  [private]
static void* Teuchos::RawWorkspace::operator new ( size_t   )  [static, private]
void Teuchos::RawWorkspace::operator delete ( void *   )  [inline, static, private]

Definition at line 528 of file Teuchos_Workspace.hpp.


Friends And Related Function Documentation

friend class WorkspaceStore [friend]

Definition at line 93 of file Teuchos_Workspace.hpp.


Member Data Documentation

Definition at line 126 of file Teuchos_Workspace.hpp.

Definition at line 127 of file Teuchos_Workspace.hpp.

Definition at line 128 of file Teuchos_Workspace.hpp.

Definition at line 129 of file Teuchos_Workspace.hpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on Tue Oct 20 10:14:05 2009 for Teuchos Package Browser (Single Doxygen Collection) by  doxygen 1.6.1