Introduction
Class xll::CellPtrConst
Class xll::CellPtrWeak
Class xll::CellPtrScoped
Class xll::CellPtrShared
Example
Frequently Asked Questions
Here you can find information about various pointers to xll::Cell.
This class provides read-only access to XLOPER structure and can be constructed out of a pointer to XLOPER. It does not do any memory menagement and implements boost::intrusive_ptr concept with dummy referencing and releasing functions.
namespace xll {
// Const pointer to Cell
template <typename T, typename Allocator = details::AllocatorDef<T> >
class CellPtrConst : public details::CellPtrConst <T, Allocator, Cell, boost::intrusive_pointer >
{
typedef details::CellPtrConst <T, Allocator, Cell, boost::intrusive_ptr > _Super;
public:
CellPtrConst (const XLOPER *rhs);
};
}
typedef Cell<T> value_type;
Dereferencing of this pointer type gives
Cell<T>object type.
CellPtrConst (const XLOPER *rhs);
Effects: creates a smart pointer wrapper around input XLOPER structure.
Postconditions:
CellPtrConst<T>::get() == rhs;Throws: std::bad_cast if data defined in input XLOPER cannot be converted to type T.
[This pointer class can be viewed as a pointer to const XLOPER from one side, and as a pointer to Cell<T> from another.
So, the following assignments are legal:
CellPtrConst<std::string> p(xloper_ptr); const XLOPER *x = p; std::string s = *p;Note that the class maintains constness. The following would result in compile error:
CellPtrConst<std::string> p(xloper_ptr); *p = "bad idea"; std::string s = *p; // OK]
operator const XLOPER * () const; // never throws
Returns: static cast to XLOPER* of
thisThrows: nothing
Notes: Provides read-only access to XLOPER.
$Date: 2007/04/18 20:01:34 $
Copyright 2007 ---