version 1.1.2.2, 2001/11/26 20:48:00
|
version 1.6, 2002/01/04 01:56:03
|
|
|
| |
#include <Pegasus/Common/AsyncOpNode.h> | #include <Pegasus/Common/AsyncOpNode.h> |
| |
PEGASUS_USING_STD; |
|
|
|
|
|
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
// const Uint32 AsyncOpFlags::UNKNOWN = 0x00000000; |
|
// const Uint32 AsyncOpFlags::DELIVER = 0x00000001; |
|
// const Uint32 AsyncOpFlags::RESERVE = 0x00000002; |
|
// const Uint32 AsyncOpFlags::PROCESSING = 0x00000004; |
|
// const Uint32 AsyncOpFlags::COMPLETE = 0x00000008; |
|
// const Uint32 AsyncOpFlags::INTERVAL_REPEAT = 0x00000010; |
|
// const Uint32 AsyncOpFlags::INDICATION = 0x00000020; |
|
// const Uint32 AsyncOpFlags::REMOTE = 0x00000040; |
|
// const Uint32 AsyncOpFlags::LOCAL_OUT_OF_PROC = 0x00000080; |
|
|
|
|
|
// const Uint32 AsyncOpState::NORMAL = 0x00000000; |
|
// const Uint32 AsyncOpState::PHASED = 0x00000001; |
|
// const Uint32 AsyncOpState::PARTIAL = 0x00000002; |
|
// const Uint32 AsyncOpState::TIMEOUT = 0x00000004; |
|
// const Uint32 AsyncOpState::SINGLE = 0x00000008; |
|
// const Uint32 AsyncOpState::MULTIPLE = 0x00000010; |
|
// const Uint32 AsyncOpState::TOTAL = 0x00000020; |
|
| |
|
AsyncOpNode::AsyncOpNode(void) |
|
: _client_sem(1), _mut(), _request(true), _response(true), |
|
_state(0), _flags(0), _total_ops(0), _completed_ops(0), |
|
_parent(0), _children(true) |
|
{ |
|
gettimeofday(&_start, NULL); |
|
memset(&_lifetime, 0x00, sizeof(struct timeval)); |
|
memset(&_updated, 0x00, sizeof(struct timeval)); |
|
memset(&_timeout_interval, 0xff, sizeof(struct timeval)); |
|
} |
|
|
|
AsyncOpNode::~AsyncOpNode(void) |
|
{ |
|
_request.empty_list(); |
|
_response.empty_list(); |
|
} |
|
|
|
|
|
void AsyncOpNode::_reset(unlocked_dq<AsyncOpNode> *dst_q) |
|
{ |
|
AsyncOpNode *child = _children.remove_first(); |
|
while( child != 0 ) |
|
{ |
|
child->_reset(dst_q); |
|
child = _children.remove_first(); |
|
} |
|
|
|
_parent = 0; |
|
_request.empty_list(); |
|
_response.empty_list(); |
|
_operation_list.reset(); |
|
_state = 0; |
|
_flags = 0; |
|
_total_ops = 0; |
|
_completed_ops = 0; |
|
dst_q->insert_first(this); |
|
while ( _client_sem.count() ) |
|
_client_sem.wait(); |
|
PEGASUS_ASSERT( _client_sem.count() == 0 ); |
|
|
|
return; |
|
} |
| |
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |