クラス sc_core::sc_plist_base

#include <sc_list.h>

sc_core::sc_plist_baseに対する継承グラフ

Inheritance graph
[凡例]

すべてのメンバ一覧

Public 型

typedef sc_plist_elemhandle_t

Public メソッド

 sc_plist_base ()
 ~sc_plist_base ()
handle_t push_back (void *d)
handle_t push_front (void *d)
void * pop_back ()
void * pop_front ()
handle_t insert_before (handle_t h, void *d)
handle_t insert_after (handle_t h, void *d)
void * remove (handle_t h)
void * get (handle_t h) const
void set (handle_t h, void *d)
void mapcar (sc_plist_map_fn f, void *arg)
void * front () const
void * back () const
void erase_all ()
bool empty () const
int size () const

Private 変数

handle_t head
handle_t tail

フレンド

class sc_plist_base_iter


説明

sc_list.h56 行で定義されています。


型定義

sc_list.h63 行で定義されています。


コンストラクタとデストラクタ

sc_core::sc_plist_base::sc_plist_base (  ) 

sc_list.cpp80 行で定義されています。

00081 {
00082     head = 0;
00083     tail = 0;
00084 }

sc_core::sc_plist_base::~sc_plist_base (  ) 

sc_list.cpp86 行で定義されています。

00087 {
00088     handle_t p;
00089     for( handle_t h = head; h != 0; h = p ) {
00090         p = h->next;
00091         delete h;
00092     }
00093 }


関数

sc_plist_base::handle_t sc_core::sc_plist_base::push_back ( void *  d  ) 

sc_list.cpp118 行で定義されています。

00119 {
00120     handle_t q = new sc_plist_elem( d, tail, 0 );
00121     if (tail) {
00122         tail->next = q;
00123         tail = q;
00124     }
00125     else {
00126         head = tail = q;
00127     }
00128     return q;
00129 }

sc_plist_base::handle_t sc_core::sc_plist_base::push_front ( void *  d  ) 

sc_list.cpp132 行で定義されています。

00133 {
00134     handle_t q = new sc_plist_elem( d, (sc_plist_elem*) 0, head );
00135     if (head) {
00136         head->prev = q;
00137         head = q;
00138     }
00139     else {
00140         head = tail = q;
00141     }
00142     return q;
00143 }

void * sc_core::sc_plist_base::pop_back (  ) 

sc_core::sc_plist< T >, と sc_core::sc_plist< sc_core::sc_module * >で再定義されています。

sc_list.cpp146 行で定義されています。

00147 {
00148     handle_t q = tail;
00149     void* d = q->data;
00150     tail = tail->prev;
00151     delete q;
00152     if (tail != 0) {
00153         tail->next = 0;
00154     }
00155     else {
00156         head = 0;
00157     }
00158     return d;
00159 }

void * sc_core::sc_plist_base::pop_front (  ) 

sc_core::sc_plist< T >, と sc_core::sc_plist< sc_core::sc_module * >で再定義されています。

sc_list.cpp162 行で定義されています。

00163 {
00164     handle_t q = head;
00165     void* d = q->data;
00166     head = head->next;
00167     delete q;
00168     if (head != 0) {
00169         head->prev = 0;
00170     }
00171     else {
00172         tail = 0;
00173     }
00174     return d;
00175 }

sc_plist_base::handle_t sc_core::sc_plist_base::insert_before ( handle_t  h,
void *  d 
)

sc_list.cpp178 行で定義されています。

00179 {
00180     if (h == 0) {
00181         return push_back(d);
00182     }
00183     else {
00184         handle_t q = new sc_plist_elem( d, h->prev, h );
00185         h->prev->next = q;
00186         h->prev = q;
00187         return q;
00188     }
00189 }

sc_plist_base::handle_t sc_core::sc_plist_base::insert_after ( handle_t  h,
void *  d 
)

sc_list.cpp192 行で定義されています。

00193 {
00194     if (h == 0) {
00195         return push_front(d);
00196     }
00197     else {
00198         handle_t q = new sc_plist_elem( d, h, h->next );
00199         h->next->prev = q;
00200         h->next = q;
00201         return q;
00202     }
00203 }

void * sc_core::sc_plist_base::remove ( handle_t  h  ) 

sc_core::sc_plist< T >, と sc_core::sc_plist< sc_core::sc_module * >で再定義されています。

sc_list.cpp206 行で定義されています。

00207 {
00208     if (h == head)
00209         return pop_front();
00210     else if (h == tail)
00211         return pop_back();
00212     else {
00213         void* d = h->data;
00214         h->prev->next = h->next;
00215         h->next->prev = h->prev;
00216         delete h;
00217         return d;
00218     }
00219 }

void * sc_core::sc_plist_base::get ( handle_t  h  )  const

sc_core::sc_plist< T >, と sc_core::sc_plist< sc_core::sc_module * >で再定義されています。

sc_list.cpp222 行で定義されています。

00223 {
00224     return h->data;
00225 }

void sc_core::sc_plist_base::set ( handle_t  h,
void *  d 
)

sc_list.cpp228 行で定義されています。

00229 {
00230     h->data = d;
00231 }

void sc_core::sc_plist_base::mapcar ( sc_plist_map_fn  f,
void *  arg 
)

sc_list.cpp234 行で定義されています。

00235 {
00236     for (handle_t h = head; h != 0; h = h->next) {
00237         f( h->data, arg );
00238     }
00239 }

void * sc_core::sc_plist_base::front (  )  const

sc_core::sc_plist< T >, と sc_core::sc_plist< sc_core::sc_module * >で再定義されています。

sc_list.cpp242 行で定義されています。

00243 {
00244 
00245    if (head) {                  
00246         return head->data;
00247     }                           
00248     else {
00249       SC_REPORT_ERROR( SC_ID_FRONT_ON_EMPTY_LIST_ , 0 );
00250       // never reached
00251       return 0;
00252     }
00253 }

void * sc_core::sc_plist_base::back (  )  const

sc_core::sc_plist< T >, と sc_core::sc_plist< sc_core::sc_module * >で再定義されています。

sc_list.cpp256 行で定義されています。

00257 {
00258    if (tail) {
00259         return tail->data;
00260     }
00261     else {
00262       SC_REPORT_ERROR( SC_ID_BACK_ON_EMPTY_LIST_, 0 );
00263       // never reached
00264       return 0;
00265     }
00266 }

void sc_core::sc_plist_base::erase_all (  ) 

sc_list.cpp96 行で定義されています。

00097 {
00098     handle_t p;
00099     for( handle_t h = head; h != 0; h = p ) {
00100         p = h->next;
00101         delete h;
00102     }
00103     head = 0;
00104     tail = 0;
00105 }

bool sc_core::sc_plist_base::empty (  )  const [inline]

sc_list.h80 行で定義されています。

00080 { return (head == 0); }

int sc_core::sc_plist_base::size (  )  const

sc_list.cpp108 行で定義されています。

00109 {
00110     int n = 0;
00111     for( handle_t h = head; h != 0; h = h->next ) {
00112         n++;
00113     }
00114     return n;
00115 }


フレンドと関連する関数

friend class sc_plist_base_iter [friend]

sc_list.h57 行で定義されています。


変数

sc_list.h84 行で定義されています。

sc_list.h85 行で定義されています。


このクラスの説明は次のファイルから生成されました:

SystemCに対してFri Jun 6 20:12:22 2008に生成されました。  doxygen 1.5.6