Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FaceListList Class Reference

#include <FaceListList.hpp>

Collaboration diagram for FaceListList:

Classes

struct  Elem
 

Public Member Functions

 FaceListList ()
 
 FaceListList (const FaceListList &olist)
 
 ~FaceListList ()
 
const FaceListListoperator= (const FaceListList &olist)
 
void append (FaceList *val)
 
void insert (FaceList *val)
 
void insert_first (FaceList *val)
 
void reset ()
 
void next ()
 
FaceListget ()
 
FaceListremove ()
 
boolean empty ()
 
int size ()
 
boolean move_to (FaceList *val)
 
int index () const
 
void index (int ind)
 

Private Attributes

Elemd_first
 
Elemd_current
 
int d_size
 

Detailed Description

Definition at line 7 of file FaceListList.hpp.

Constructor & Destructor Documentation

Definition at line 5 of file FaceListList.cpp.

5  :
6  d_first(0),
7  d_current(0),
8  d_size(0) {}
Elem * d_current
FaceListList ( const FaceListList olist)

Definition at line 10 of file FaceListList.cpp.

References d_current, d_first, FaceListList::Elem::d_next, and FaceListList::Elem::d_val.

10  :
11  d_size(olist.d_size) {
12 
13  // just add all the list
14  Elem* oval = olist.d_first;
15  Elem* prev(0);
16  while( oval ){
17  Elem *nelem = new FaceListList::Elem( oval->d_val );
18  if( prev ){
19  prev->d_next = nelem;
20  }
21  else {
22  d_first = nelem;
23  }
24  prev = nelem;
25  oval = oval->d_next;
26  }
28 }
Elem * d_current

Definition at line 31 of file FaceListList.cpp.

References d_first.

31  {
32  if( d_first ) delete d_first;
33 }

Member Function Documentation

void append ( FaceList val)

Definition at line 58 of file FaceListList.cpp.

References d_current, d_first, FaceListList::Elem::d_next, and d_size.

58  {
59 
60  Elem* bef(0);
61  Elem* af( d_first );
62  while( af ){
63  bef = af;
64  af = af->d_next;
65  }
66  if( bef ){
67  bef->d_next = new FaceListList::Elem( val );
68  }
69  else {
70  d_first = new Elem( val );
72  }
73  d_size++;
74 }
Elem * d_current
boolean empty ( void  )
inline

Definition at line 91 of file FaceListList.hpp.

References d_size, FALSE, and TRUE.

91  {
92  return ( d_size <= 0 ? TRUE : FALSE);
93 }
#define FALSE
Definition: vinci.h:133
#define TRUE
Definition: vinci.h:134
FaceList * get ( )
inline

Definition at line 87 of file FaceListList.hpp.

References d_current, and FaceListList::Elem::d_val.

Referenced by Mesh::addCohesive().

87  {
88  return d_current->d_val;
89 }
Elem * d_current

Here is the caller graph for this function:

int index ( ) const

Definition at line 110 of file FaceListList.cpp.

References d_current, d_first, and FaceListList::Elem::d_next.

Referenced by Mesh::addCohesive().

110  {
111 
112  int ind = 0;
113  Elem* pass = d_first;
114  while( pass != d_current ){
115  ind++;
116  pass = pass->d_next;
117  }
118  return ind;
119 }
Elem * d_current

Here is the caller graph for this function:

void index ( int  ind)

Definition at line 121 of file FaceListList.cpp.

References d_current, d_first, FaceListList::Elem::d_next, and i.

121  {
122 
123  d_current = d_first;
124  int i;
125  for( i = 0; i < ind; i++ ){
127  }
128 }
Elem * d_current
blockLoc i
Definition: read.cpp:79
void insert ( FaceList val)
inline

Definition at line 55 of file FaceListList.hpp.

References d_current, d_first, FaceListList::Elem::d_next, and d_size.

55  { // at d_current
56  if( !d_current && d_first){
57  cerr << " Gevalt - insert\n";
58  return;
59  }
60  d_size++;
61  if( !d_current ){
62  d_first = new FaceListList::Elem( val );
64  return;
65  }
66  d_current->d_next = new Elem( val, d_current->d_next);
67 }
Elem * d_current
void insert_first ( FaceList val)
inline

Definition at line 69 of file FaceListList.hpp.

References d_current, d_first, and d_size.

Referenced by Mesh::addCohesive().

69  { // at d_current
70  d_size++;
71  d_first = new FaceListList::Elem( val, d_first);
73 }
Elem * d_current

Here is the caller graph for this function:

boolean move_to ( FaceList val)

Definition at line 102 of file FaceListList.cpp.

References d_current, d_first, FaceListList::Elem::d_next, FaceListList::Elem::d_val, FALSE, and TRUE.

102  {
103  d_current = d_first;
104  while( d_current && d_current->d_val != val ){
106  }
107  return( d_current ? TRUE : FALSE );
108 }
#define FALSE
Definition: vinci.h:133
Elem * d_current
#define TRUE
Definition: vinci.h:134
void next ( )
inline

Definition at line 80 of file FaceListList.hpp.

References d_current, d_first, and FaceListList::Elem::d_next.

Referenced by Mesh::addCohesive().

80  {
82  if( !d_current ){
84  }
85 }
Elem * d_current

Here is the caller graph for this function:

const FaceListList & operator= ( const FaceListList olist)

Definition at line 35 of file FaceListList.cpp.

References d_current, d_first, FaceListList::Elem::d_next, d_size, and FaceListList::Elem::d_val.

35  {
36 
37  if( d_first ) delete d_first;
38 
39  d_size = olist.d_size;
40  // just add all the list
41  Elem* oval = olist.d_first;
42  Elem* prev(0);
43  while( oval ){
44  Elem *nelem = new FaceListList::Elem( oval->d_val );
45  if( prev ){
46  prev->d_next = nelem;
47  }
48  else {
49  d_first = nelem;
50  }
51  prev = nelem;
52  oval = oval->d_next;
53  }
55  return *this;
56 }
Elem * d_current
FaceList * remove ( )

Definition at line 76 of file FaceListList.cpp.

References d_current, d_first, FaceListList::Elem::d_next, d_size, and FaceListList::Elem::d_val.

76  {
77  FaceList* val = d_current->d_val;
78 
79  d_size--;
80 
81  Elem* bef(0);
82  Elem* af( d_first );
83  while( af != d_current){
84  bef = af;
85  af = af->d_next;
86  }
87  if( !bef ){
89  }
90  else {
91  bef->d_next = d_current->d_next;
92  }
94  af->d_next = 0;
95  delete af;// the old current - remove only it
96  if( !d_current ) d_current = d_first;
97  return val;
98 }
Elem * d_current
void reset ( )
inline

Definition at line 76 of file FaceListList.hpp.

References d_current, and d_first.

Referenced by Mesh::addCohesive().

76  {
78 }
Elem * d_current

Here is the caller graph for this function:

int size ( )
inline

Definition at line 95 of file FaceListList.hpp.

References d_size.

95  {
96  return d_size;
97 }

Member Data Documentation

Elem* d_current
private
Elem* d_first
private
int d_size
private

Definition at line 51 of file FaceListList.hpp.

Referenced by append(), empty(), insert(), insert_first(), operator=(), remove(), and size().


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