ReactOS 0.4.15-dev-5672-gf73ac17
Maplist Class Reference

#include <maplist.h>

Collaboration diagram for Maplist:

Public Member Functions

 Maplist (Backend &)
 
void define (long, int, int)
 
void undefine (long)
 
int isMap (long)
 
void initialize (void)
 
Mapdescfind (long)
 
Mapdesclocate (long)
 

Private Member Functions

void add (long, int, int)
 
void remove (Mapdesc *)
 
void freeMaps (void)
 

Private Attributes

Pool mapdescPool
 
Mapdescmaps
 
Mapdesc ** lastmap
 
Backendbackend
 

Detailed Description

Definition at line 46 of file maplist.h.

Constructor & Destructor Documentation

◆ Maplist()

Maplist::Maplist ( Backend b)

Definition at line 48 of file maplist.cc.

49 : mapdescPool( sizeof( Mapdesc ), 10, "mapdesc pool" ),
50 backend( b )
51{
52 maps = 0; lastmap = &maps;
53}
Pool mapdescPool
Definition: maplist.h:58
Backend & backend
Definition: maplist.h:61
Mapdesc ** lastmap
Definition: maplist.h:60
Mapdesc * maps
Definition: maplist.h:59
GLboolean GLboolean GLboolean b
Definition: glext.h:6204

Member Function Documentation

◆ add()

void Maplist::add ( long  type,
int  israt,
int  ncoords 
)
private

Definition at line 64 of file maplist.cc.

65{
66 *lastmap = new(mapdescPool) Mapdesc( type, israt, ncoords, backend );
67 lastmap = &((*lastmap)->next);
68}
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545

Referenced by define().

◆ define()

void Maplist::define ( long  type,
int  israt,
int  ncoords 
)

Definition at line 71 of file maplist.cc.

72{
73#ifndef NDEBUG // to avoid warning
74 Mapdesc *m = locate( type );
75 assert( m == NULL || ( m->isrational == israt && m->ncoords == ncoords ) );
76#endif
77 add( type, israt, ncoords );
78}
void add(long, int, int)
Definition: maplist.cc:64
Mapdesc * locate(long)
Definition: maplist.cc:110
#define NULL
Definition: types.h:112
#define assert(x)
Definition: debug.h:53
const GLfloat * m
Definition: glext.h:10848

Referenced by NurbsTessellator::defineMap().

◆ find()

Mapdesc * Maplist::find ( long  type)

Definition at line 102 of file maplist.cc.

103{
104 Mapdesc *val = locate( type );
105 assert( val != 0 );
106 return val;
107}
GLuint GLfloat * val
Definition: glext.h:7180

Referenced by NurbsTessellator::do_setnurbsproperty2().

◆ freeMaps()

void Maplist::freeMaps ( void  )
private

Definition at line 94 of file maplist.cc.

95{
97 maps = 0;
98 lastmap = &maps;
99}
void clear(void)
Definition: bufpool.cc:100

Referenced by initialize().

◆ initialize()

void Maplist::initialize ( void  )

Definition at line 56 of file maplist.cc.

57{
58 freeMaps();
59 define( N_P2D, 0, 2 );
60 define( N_P2DR, 1, 3 );
61}
void freeMaps(void)
Definition: maplist.cc:94
#define N_P2D
Definition: nurbsconsts.h:116
#define N_P2DR
Definition: nurbsconsts.h:117

Referenced by NurbsTessellator::redefineMaps().

◆ isMap()

int Maplist::isMap ( long  type)
inline

Definition at line 69 of file maplist.h.

70{
71 return (locate( type ) ? 1 : 0);
72}

◆ locate()

Mapdesc * Maplist::locate ( long  type)

Definition at line 110 of file maplist.cc.

111{
112 Mapdesc *m;
113 for( m = maps; m; m = m->next )
114 if( m->getType() == type ) break;
115 return m;
116}

Referenced by define(), find(), NurbsTessellator::getnurbsproperty(), isMap(), NurbsTessellator::nurbscurve(), NurbsTessellator::nurbssurface(), NurbsTessellator::pwlcurve(), NurbsTessellator::setnurbsproperty(), and undefine().

◆ remove()

void Maplist::remove ( Mapdesc m)
private

Definition at line 81 of file maplist.cc.

82{
83 for( Mapdesc **curmap = &maps; *curmap; curmap = &((*curmap)->next) ) {
84 if( *curmap == m ) {
85 *curmap = m->next;
86 m->deleteMe( mapdescPool );
87 return;
88 }
89 }
90 abort();
91}
#define abort()
Definition: i386-dis.c:35

◆ undefine()

void Maplist::undefine ( long  type)
inline

Definition at line 75 of file maplist.h.

76{
77 Mapdesc *m = locate( type );
78 assert( m != 0 );
79 remove( m );
80}
int remove
Definition: msacm.c:1366

Member Data Documentation

◆ backend

Backend& Maplist::backend
private

Definition at line 61 of file maplist.h.

Referenced by add().

◆ lastmap

Mapdesc** Maplist::lastmap
private

Definition at line 60 of file maplist.h.

Referenced by add(), freeMaps(), and Maplist().

◆ mapdescPool

Pool Maplist::mapdescPool
private

Definition at line 58 of file maplist.h.

Referenced by add(), freeMaps(), and remove().

◆ maps

Mapdesc* Maplist::maps
private

Definition at line 59 of file maplist.h.

Referenced by freeMaps(), locate(), Maplist(), and remove().


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