#include <Teuchos_Workspace.hpp>
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 |
| |
Friends | |
class | WorkspaceStore |
|
Definition at line 90 of file Teuchos_Workspace.hpp.
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:
this->
num_bytes() == num_bytes
num_bytes > 0
] this->
workspace_ptr() + i
for i = 0,..num_bytes-1
points to valid raw ininitialized allocated memory. num_bytes == 0
] this->
workspace_ptr() == NULL
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 | ( | ) |
size_t Teuchos::RawWorkspace::num_bytes | ( | ) | const [inline] |
const char * Teuchos::RawWorkspace::workspace_ptr | ( | ) | const [inline] |
char * Teuchos::RawWorkspace::workspace_ptr | ( | ) | [inline] |
Give a raw pointer to the beginning of the workspace.
Definition at line 496 of file Teuchos_Workspace.hpp.
friend class WorkspaceStore [friend] |