version 1.56, 2004/07/01 02:26:44
|
version 1.60.2.1, 2005/01/26 16:18:38
|
|
|
//%2003//////////////////////////////////////////////////////////////////////// |
//%2004//////////////////////////////////////////////////////////////////////// |
// | // |
// Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Development |
// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development |
// Company, L. P., IBM Corp., The Open Group, Tivoli Systems. |
// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. |
// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L. P.; | // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L. P.; |
// IBM Corp.; EMC Corporation, The Open Group. | // IBM Corp.; EMC Corporation, The Open Group. |
|
// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.; |
|
// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. |
// | // |
// Permission is hereby granted, free of charge, to any person obtaining a copy | // Permission is hereby granted, free of charge, to any person obtaining a copy |
// of this software and associated documentation files (the "Software"), to | // of this software and associated documentation files (the "Software"), to |
|
|
// Arthur Pichlkostner (via Markus: sedgewick_de@yahoo.de) | // Arthur Pichlkostner (via Markus: sedgewick_de@yahoo.de) |
// Willis White (whiwill@us.ibm.com) PEP 127 and 128 | // Willis White (whiwill@us.ibm.com) PEP 127 and 128 |
// Brian G. Campbell, EMC (campbell_brian@emc.com) - PEP140/phase1 | // Brian G. Campbell, EMC (campbell_brian@emc.com) - PEP140/phase1 |
|
// Amit K Arora, IBM (amita@in.ibm.com) for Bug#1090 |
// | // |
// | // |
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
|
|
| |
void setHttpMethod(HttpMethod httpMethod) {_httpMethod = httpMethod;} | void setHttpMethod(HttpMethod httpMethod) {_httpMethod = httpMethod;} |
| |
#ifdef PEGASUS_HAS_PERFINST |
#ifndef PEGASUS_DISABLE_PERFINST |
// | // |
// Needed for performance measurement | // Needed for performance measurement |
// | // |
|
|
| |
static Uint32 getNextKey() | static Uint32 getNextKey() |
{ | { |
|
AutoMutex autoMut(_mut); |
_mut.lock( pegasus_thread_self() ) ; |
|
Uint32 ret = _nextKey++; | Uint32 ret = _nextKey++; |
_mut.unlock(); |
|
return ret; | return ret; |
} | } |
| |
|
|
stack of queue-ids of queues which they must be returned to. This provides | stack of queue-ids of queues which they must be returned to. This provides |
a light efficient stack for this purpose. | a light efficient stack for this purpose. |
*/ | */ |
class QueueIdStack |
class PEGASUS_COMMON_LINKAGE QueueIdStack |
{ | { |
public: | public: |
| |
|
|
{ | { |
} | } |
| |
QueueIdStack(const QueueIdStack& x) : _size(x._size) |
QueueIdStack(const QueueIdStack& x); |
{ |
|
memcpy(_items, x._items, sizeof(_items)); |
|
} |
|
| |
PEGASUS_EXPLICIT QueueIdStack(Uint32 x) : _size(0) |
PEGASUS_EXPLICIT QueueIdStack(Uint32 x); |
{ |
|
push(x); |
|
} |
|
| |
PEGASUS_EXPLICIT QueueIdStack(Uint32 x1, Uint32 x2) : _size(0) |
PEGASUS_EXPLICIT QueueIdStack(Uint32 x1, Uint32 x2); |
{ |
|
push(x1); |
|
push(x2); |
|
} |
|
| |
~QueueIdStack() | ~QueueIdStack() |
{ | { |
} | } |
| |
QueueIdStack& operator=(const QueueIdStack& x) |
QueueIdStack& operator=(const QueueIdStack& x); |
{ |
|
if (this != &x) |
|
{ |
|
memcpy(_items, x._items, sizeof(_items)); |
|
_size = x._size; |
|
} |
|
return *this; |
|
} |
|
| |
Uint32 size() const | Uint32 size() const |
{ | { |
|
|
| |
void push(Uint32 x) | void push(Uint32 x) |
{ | { |
|
#ifdef PEGASUS_DEBUG |
if (_size == MAX_SIZE) | if (_size == MAX_SIZE) |
throw StackOverflow(); | throw StackOverflow(); |
|
#endif |
_items[_size++] = x; | _items[_size++] = x; |
} | } |
| |
Uint32& top() | Uint32& top() |
{ | { |
|
#ifdef PEGASUS_DEBUG |
if (_size == 0) | if (_size == 0) |
throw StackUnderflow(); | throw StackUnderflow(); |
|
#endif |
return _items[_size-1]; | return _items[_size-1]; |
} | } |
| |
|
|
| |
void pop() | void pop() |
{ | { |
|
#ifdef PEGASUS_DEBUG |
if (_size == 0) | if (_size == 0) |
throw StackUnderflow(); | throw StackUnderflow(); |
|
#endif |
_size--; | _size--; |
} | } |
| |
/** Make a copy of this stack and then pop the top element. */ | /** Make a copy of this stack and then pop the top element. */ |
QueueIdStack copyAndPop() const |
QueueIdStack copyAndPop() const; |
{ |
|
return QueueIdStack(*this, 0); |
|
} |
|
| |
private: | private: |
| |
// Copy the given stack but then pop the top element: | // Copy the given stack but then pop the top element: |
QueueIdStack(const QueueIdStack& x, int) : _size(x._size) |
QueueIdStack(const QueueIdStack& x, int); |
{ |
|
memcpy(_items, x._items, sizeof(_items)); |
|
pop(); |
|
} |
|
| |
enum { MAX_SIZE = 5 }; | enum { MAX_SIZE = 5 }; |
Uint32 _items[MAX_SIZE]; | Uint32 _items[MAX_SIZE]; |