Loading...
Searching...
No Matches
SBucketFactory Class Reference

sBucket Factory More...

`#include <syzextra.h>`

## Public Types

typedef Base::value_type | Bucket

## Public Member Functions

| SBucketFactory (const ring r)
| ~SBucketFactory ()
Bucket | getBucket (const ring r, const bool remove=true)
void | putBucket (const Bucket &bt, const bool replace=false)

## Private Types

typedef std::stack< sBucket_pt > | Base

## Private Member Functions

| SBucketFactory ()
| SBucketFactory (const SBucketFactory &)
void | operator= (const SBucketFactory &)

## Static Private Member Functions

static Bucket | _CreateBucket (const ring r)
| inital allocation for new buckets
static void | _DestroyBucket (Bucket &bt)
| we only expect empty buckets to be left at the end for destructor bt will be set to NULL

## Detailed Description

sBucket Factory

Cleate/store/reuse buckets

Definition at line 56 of file syzextra.h.

## Member Typedef Documentation

## Base

typedef std::stack<sBucket_pt> SBucketFactory::Base

private

Definition at line 59 of file syzextra.h.

## Bucket

typedef Base::value_type SBucketFactory::Bucket

Definition at line 62 of file syzextra.h.

## Constructor & Destructor Documentation

## SBucketFactory() [1/3]

SBucketFactory::SBucketFactory | ( | const ring | r | ) |

inline

Definition at line 64 of file syzextra.h.

{
push ( _CreateBucket(r) ); // start with at least one sBucket...?
assume( top() != NULL );
};
SBucketFactory::_CreateBucket
static Bucket _CreateBucket(const ring r)
inital allocation for new buckets
assume
#define assume(x)
Definition mod2.h:389
NULL
#define NULL
Definition omList.c:12

## ~SBucketFactory()

SBucketFactory::~SBucketFactory | ( |  | ) |

inline

Definition at line 70 of file syzextra.h.

{
while( !empty() )
{
_DestroyBucket( top() );
pop();
}
}
SBucketFactory::_DestroyBucket
static void _DestroyBucket(Bucket &bt)
we only expect empty buckets to be left at the end for destructor bt will be set to NULL

## SBucketFactory() [2/3]

SBucketFactory::SBucketFactory | ( |  | ) |

private

## SBucketFactory() [3/3]

SBucketFactory::SBucketFactory | ( | const SBucketFactory & |  | ) |

private

## Member Function Documentation

## _CreateBucket()

Bucket SBucketFactory::_CreateBucket | ( | const ring | r | ) |

static private

inital allocation for new buckets

## _DestroyBucket()

void SBucketFactory::_DestroyBucket | ( | Bucket & | bt | ) |

static private

we only expect empty buckets to be left at the end for destructor bt will be set to NULL

## getBucket()

Bucket SBucketFactory::getBucket | ( | const ring | r,
|  | const bool | remove = true )

inline

Definition at line 79 of file syzextra.h.

{
Bucket bt = NULL;
if( !empty() )
{
bt = top();
if( remove )
pop();
}
else
{
bt = _CreateBucket(r);
if( !remove )
{
push(bt);
assume( bt == top() );
}
}
assume( bt != NULL );
return bt;
}
SBucketFactory::Bucket
Base::value_type Bucket
Definition syzextra.h:62

## operator=()

void SBucketFactory::operator= | ( | const SBucketFactory & |  | ) |

private

## putBucket()

void SBucketFactory::putBucket | ( | const Bucket & | bt,
|  | const bool | replace = false )

inline

Definition at line 107 of file syzextra.h.

{
assume( bt != NULL );
if( empty() )
push( bt );
else
{
if( replace )
top() = bt;
else
{
if( bt != top() )
push( bt );
}
}
assume( bt == top() );
}

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

- Singular/dyn_modules/syzextra/syzextra.h