Ice Sheet System Model  4.18
Code documentation
Static Public Member Functions | Static Private Attributes
ToolkitOptions Class Reference

#include <ToolkitOptions.h>

Static Public Member Functions

static void Init (const char *type_in, const char *options)
 
static void Init (void)
 
static char * GetToolkitType (void)
 
static char * GetToolkitOptionValue (const char *option)
 

Static Private Attributes

static char * toolkittype
 
static char * toolkitoptions
 

Detailed Description

Definition at line 10 of file ToolkitOptions.h.

Member Function Documentation

◆ Init() [1/2]

void ToolkitOptions::Init ( const char *  type_in,
const char *  options 
)
static

Definition at line 11 of file ToolkitOptions.cpp.

11  { /*{{{*/
12 
13  /*First, avoid a leak: */
14  xDelete<char>(toolkitoptions);
15  xDelete<char>(toolkittype);
16 
17  /*copy options into toolkitoptions:*/
18  _assert_(toolkit_in);
19  _assert_(options);
20  toolkittype = xNew<char>(strlen(toolkit_in)+1);
21  sprintf(toolkittype,"%s",toolkit_in);
22  toolkitoptions = xNew<char>(strlen(options)+1);
23  sprintf(toolkitoptions,"%s",options);
24 }/*}}}*/

◆ Init() [2/2]

void ToolkitOptions::Init ( void  )
static

Definition at line 25 of file ToolkitOptions.cpp.

25  { /*{{{*/
26  toolkittype = NULL;
27  toolkitoptions = NULL;
28 }/*}}}*/

◆ GetToolkitType()

char * ToolkitOptions::GetToolkitType ( void  )
static

Definition at line 29 of file ToolkitOptions.cpp.

29  { /*{{{*/
30 
31  if(toolkittype==NULL) _error_("toolkittype not set (may be a mex?)");
32  char* toolkittype_out = xNew<char>(strlen(toolkittype)+1);
33  sprintf(toolkittype_out,"%s",toolkittype);
34  return toolkittype_out;
35 }/*}}}*/

◆ GetToolkitOptionValue()

char * ToolkitOptions::GetToolkitOptionValue ( const char *  option)
static

Definition at line 36 of file ToolkitOptions.cpp.

36  { /*{{{*/
37 
38  return TokenValue(toolkitoptions,option);
39 
40 }/*}}}*/

Field Documentation

◆ toolkittype

char * ToolkitOptions::toolkittype
staticprivate

Definition at line 13 of file ToolkitOptions.h.

◆ toolkitoptions

char * ToolkitOptions::toolkitoptions
staticprivate

Definition at line 14 of file ToolkitOptions.h.


The documentation for this class was generated from the following files:
_assert_
#define _assert_(ignore)
Definition: exceptions.h:37
ToolkitOptions::toolkittype
static char * toolkittype
Definition: ToolkitOptions.h:13
TokenValue
char * TokenValue(char *tokenlist, const char *target)
Definition: ToolkitOptions.cpp:41
_error_
#define _error_(StreamArgs)
Definition: exceptions.h:49
ToolkitOptions::toolkitoptions
static char * toolkitoptions
Definition: ToolkitOptions.h:14