NAMD
Public Member Functions | Public Attributes | List of all members
ConfigList::ConfigListNode Class Reference

#include <ConfigList.h>

Public Member Functions

 ConfigListNode (ConfigListNode *newnext, char *newname, StringList *newdata)
 
 ~ConfigListNode (void)
 

Public Attributes

char * name
 
StringListdata
 
ConfigListNodenext
 

Detailed Description

Definition at line 77 of file ConfigList.h.

Constructor & Destructor Documentation

ConfigList::ConfigListNode::ConfigListNode ( ConfigListNode newnext,
char *  newname,
StringList newdata 
)
inline

Definition at line 84 of file ConfigList.h.

References data, NAMD_die(), name, and next.

85  {
86  name = new char[strlen(newname)+1]; // create space for the name
87  if ( name == NULL )
88  {
89  NAMD_die("new failed in ConfigListNode::ConfigListNode");
90  }
91  strcpy((char *) name, newname); // and copy the new name
92  data = newdata;
93  next = newnext;
94  }
void NAMD_die(const char *err_msg)
Definition: common.C:85
ConfigListNode * next
Definition: ConfigList.h:83
ConfigList::ConfigListNode::~ConfigListNode ( void  )
inline

Definition at line 95 of file ConfigList.h.

References data, name, StringList::next, and next.

96  {
97  delete [] name; // delete the new'ed name
98  name = NULL;
99  next = NULL;
100  StringList *curr=data, *next_local=NULL; // go through the string list
101 
102  while ( curr!=NULL )
103  {
104  next_local = curr->next; // and delete each element
105  delete curr;
106  curr = next_local;
107  }
108  }
StringList * next
Definition: ConfigList.h:49
ConfigListNode * next
Definition: ConfigList.h:83

Member Data Documentation

StringList* ConfigList::ConfigListNode::data

Definition at line 82 of file ConfigList.h.

Referenced by ConfigListNode(), and ~ConfigListNode().

char* ConfigList::ConfigListNode::name

Definition at line 81 of file ConfigList.h.

Referenced by ConfigListNode(), and ~ConfigListNode().

ConfigListNode* ConfigList::ConfigListNode::next

Definition at line 83 of file ConfigList.h.

Referenced by ConfigListNode(), and ~ConfigListNode().


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