Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FaceListList.hpp
Go to the documentation of this file.
1 #ifndef FACELISTLIST_HPP
2 #define FACELISTLIST_HPP
3 
4 #include "general.hpp"
5 #include "FaceList.hpp"
6 
7 class FaceListList {
8 public:
9 
10  FaceListList();
11  FaceListList( const FaceListList& olist );
12  ~FaceListList();
13 
14  const FaceListList& operator=( const FaceListList& olist);
15 
16  void append(FaceList* val);
17  void insert(FaceList* val);
18  void insert_first(FaceList* val);
19 
20  void reset();
21  void next();
22 
23  FaceList* get();
24  FaceList* remove();
25 
26  boolean empty();
27  int size();
28 
29  boolean move_to(FaceList* val);
30  int index() const;
31  void index( int ind );
32 
33 private:
34 
35  struct Elem {
38 
39  Elem() : d_val(0), d_next(0) {}
40  Elem(FaceList* val, Elem* next = 0) :
41  d_val(val), d_next(next) {}
42 
43  ~Elem() {
44  if( d_next ) delete d_next;
45  }
46  };
47 
50 
51  int d_size;
52 };
53 
54 
55 inline void FaceListList::insert(FaceList* val) { // 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 }
68 
69 inline void FaceListList::insert_first(FaceList* val) { // at d_current
70  d_size++;
71  d_first = new FaceListList::Elem( val, d_first);
73 }
74 
75 
76 inline void FaceListList::reset() {
78 }
79 
80 inline void FaceListList::next() {
82  if( !d_current ){
84  }
85 }
86 
88  return d_current->d_val;
89 }
90 
91 inline boolean FaceListList::empty(){
92  return ( d_size <= 0 ? TRUE : FALSE);
93 }
94 
95 inline int FaceListList::size(){
96  return d_size;
97 }
98 
99 
100 #endif
101 
102 
103 
104 
#define FALSE
Definition: vinci.h:133
void insert_first(FaceList *val)
Elem * d_current
int index() const
boolean empty()
Elem(FaceList *val, Elem *next=0)
FaceList * get()
boolean move_to(FaceList *val)
#define TRUE
Definition: vinci.h:134
void append(FaceList *val)
const FaceListList & operator=(const FaceListList &olist)
void insert(FaceList *val)