OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
C4GroupSetNode Class Reference

#include <C4GroupSet.h>

Collaboration diagram for C4GroupSetNode:
[legend]

Public Member Functions

 C4GroupSetNode (class C4GroupSet &rParent, C4GroupSetNode *pPrev, C4Group &rGroup, bool fGrpOwned, int32_t id)
 
 ~C4GroupSetNode ()
 

Public Attributes

int32_t Priority
 
int32_t Contents
 

Protected Attributes

class C4GroupSetpParent
 
C4GroupSetNodepPrev
 
C4GroupSetNodepNext
 
C4GrouppGroup
 
bool fGrpOwned
 
int32_t id
 

Friends

class C4GroupSet
 

Detailed Description

Definition at line 54 of file C4GroupSet.h.

Constructor & Destructor Documentation

C4GroupSetNode::C4GroupSetNode ( class C4GroupSet rParent,
C4GroupSetNode pPrev,
C4Group rGroup,
bool  fGrpOwned,
int32_t  id 
)

Definition at line 25 of file C4GroupSet.cpp.

References fGrpOwned, id, C4GroupSet::pFirst, pGroup, C4GroupSet::pLast, pNext, pParent, and pPrev.

26 {
27  // set parent
28  pParent = &rParent;
29  // link into list
30  this->pPrev=pPrev;
31  if (pPrev) { pNext=pPrev->pNext; pPrev->pNext=this; }
32  else { pNext=pParent->pFirst; pParent->pFirst=this; }
33  if (pNext) pNext->pPrev=this; else pParent->pLast=this;
34  // set group
35  pGroup = &rGroup;
36  this->fGrpOwned = fGrpOwned;
37  // set id
38  this->id = id;
39 }
class C4GroupSet * pParent
Definition: C4GroupSet.h:57
C4GroupSetNode * pPrev
Definition: C4GroupSet.h:58
C4GroupSetNode * pLast
Definition: C4GroupSet.h:79
int32_t id
Definition: C4GroupSet.h:63
C4GroupSetNode * pFirst
Definition: C4GroupSet.h:79
C4GroupSetNode * pNext
Definition: C4GroupSet.h:58
C4Group * pGroup
Definition: C4GroupSet.h:60
C4GroupSetNode::~C4GroupSetNode ( )

Definition at line 41 of file C4GroupSet.cpp.

References fGrpOwned, C4GroupSet::pFirst, pGroup, C4GroupSet::pLast, pNext, pParent, and pPrev.

42 {
43  // remove group
44  if (fGrpOwned) delete pGroup;
45  // unlink from list
46  (pPrev ? pPrev->pNext : pParent->pFirst) = pNext;
47  (pNext ? pNext->pPrev : pParent->pLast ) = pPrev;
48 }
class C4GroupSet * pParent
Definition: C4GroupSet.h:57
C4GroupSetNode * pPrev
Definition: C4GroupSet.h:58
C4GroupSetNode * pLast
Definition: C4GroupSet.h:79
C4GroupSetNode * pFirst
Definition: C4GroupSet.h:79
C4GroupSetNode * pNext
Definition: C4GroupSet.h:58
C4Group * pGroup
Definition: C4GroupSet.h:60

Friends And Related Function Documentation

friend class C4GroupSet
friend

Definition at line 72 of file C4GroupSet.h.

Member Data Documentation

int32_t C4GroupSetNode::Contents

Definition at line 70 of file C4GroupSet.h.

Referenced by C4GroupSet::RegisterGroup().

bool C4GroupSetNode::fGrpOwned
protected

Definition at line 61 of file C4GroupSet.h.

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

int32_t C4GroupSetNode::id
protected

Definition at line 63 of file C4GroupSet.h.

Referenced by C4GroupSetNode().

C4Group* C4GroupSetNode::pGroup
protected

Definition at line 60 of file C4GroupSet.h.

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

class C4GroupSet* C4GroupSetNode::pParent
protected

Definition at line 57 of file C4GroupSet.h.

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

C4GroupSetNode* C4GroupSetNode::pPrev
protected

Definition at line 58 of file C4GroupSet.h.

Referenced by C4GroupSetNode(), C4GroupSet::RegisterGroup(), and ~C4GroupSetNode().

int32_t C4GroupSetNode::Priority

Definition at line 69 of file C4GroupSet.h.

Referenced by C4GroupSet::RegisterGroup().


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