Cell Pointer Template Classes

Introduction
Class xll::CellPtrConst
Class xll::CellPtrWeak
Class xll::CellPtrScoped
Class xll::CellPtrShared
Example
Frequently Asked Questions

Introduction

Here you can find information about various pointers to xll::Cell.

Class xll::CellPtrConst

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.

Synopsis

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);
};
}

Members

value_type

typedef Cell<T> value_type;

Dereferencing of this pointer type gives Cell<T> object type.

constructor

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
		
]

access to XLOPER

operator const XLOPER * () const; // never throws

Returns: static cast to XLOPER* of this

Throws: nothing

Notes: Provides read-only access to XLOPER.

Example

Frequently Asked Questions


$Date: 2007/04/18 20:01:34 $

Copyright 2007 ---