55 Workspace::wsv_data.push_back(wsv);
62 ws.push_back(stack<WsvStruct *>());
69 if (wsvs && wsvs->
wsv) {
81 if (
ws[i].size() &&
ws[i].top()->wsv) {
96 for (
Index i = 0;
i < workspace.
ws.nelem();
i++) {
99 if (workspace.
ws[
i].size() && workspace.
ws[
i].top()->wsv) {
100 wsvs->
wsv = workspace.
ws[
i].top()->wsv;
112 #pragma omp critical(ws_destruct) 115 for (
int i = 0;
i <
ws.nelem();
i++) {
118 while (
ws[
i].size()) {
170 if (!
ws[i].size())
push(i, NULL);
172 if (!
ws[i].top()->wsv) {
173 ws[
i].top()->auto_allocated =
true;
177 ws[
i].top()->initialized =
true;
179 return (
ws[i].top()->wsv);
INDEX Index
The type to use for all integer numbers and indices.
static Array< WsvRecord > wsv_data
Global WSV data.
Index nelem() const
Number of elements.
void duplicate(Index i)
Duplicate WSV.
void * duplicate(Index group_index, void *ptr)
Duplicate workspace variable of given group.
void pop_free(Index i)
Remove the topmost WSV from its stack and free its memory.
This file contains the Workspace class.
String context
Debugging context.
WorkspaceMemoryHandler workspace_memory_handler
The workspace memory handler Defined in workspace_ng.cc.
virtual ~Workspace()
Destruct the workspace and free all WSVs.
void * operator[](Index i)
Retrieve a pointer to the given WSV.
Index nelem()
Get the number of workspace variables.
void * allocate(Index group_index)
Allocate workspace WSV of given group.
void * pop(Index i)
Remove the topmost WSV from its stack.
Workspace()
Construct a new workspace.
void deallocate(Index group_index, void *ptr)
Getaway function to call the deallocation function for the WSV group with the given Index...
void push(Index i, void *wsv)
Push a new WSV onto its stack.
static map< String, Index > WsvMap
Global map associated with wsv_data.
static Index add_wsv(const WsvRecord &wsv)
Append a new WSV to the workspace.
void push_uninitialized(Index i, void *wsv)
Put a new WSV onto its stack.
Array< stack< WsvStruct * > > ws
Workspace variable container.
static void define_wsv_map()
Map WSV names to indices.
Index add_wsv_inplace(const WsvRecord &wsv)
Add a new variable to existing workspace and to the static maps.
This class contains all static information for one workspace variable.
The WorkspaceMemoryHandler.
void del(Index i)
Delete WSV.
Handling of workspace memory.
Auxiliary header stuff related to workspace variable groups.