Function CSPPool<T>::ObjectPtr::Attach()

Description:
Attaches a pooled object from a tread safe pool.

Prototype:
void Attach(CSPPool<T>& Pool);

Arguments:
  • CSPPool<T>& Pool [IN]
    The pool to get the object from.



Return value:
No return value (void).

Remarks:
When the smart pointer is destructed, the pooled object is automatically returned back to the pool. You can also return the object back to the pool by calling Release().
If this member function is called when another object is already attached to the smart pointer, that object is automatically returned to the pool before the new object is attached.

Examples:
CSPPool<CSPString> Pool;
Pool.Add( "Hello", 10 );
....
CSPPool<CSPString>::ObjectPtr spString;
spString.Attach( Pool );

See also:
member function operator = (), CSPPool::Get(), Release()
CSPPool<T>::ObjectPtr | Template classes | Class Categories | Online help home | Back

www.micronovae.com

Copyright © 2002 - 2005 Micronovae Ltd