It could be a possible begin :) :
class CShape : public CObject
{
..
};
class CCircle : public CShape
{
..
};
class CTransaction : public CObject
{
..
};
template <typename T>
class CShapeTransaction : public CTransaction
{
T* m_ptShape;
..
public:
..
T* GetShape() { return m_ptShape; }
..
};
class CAddCircleTrasaction : public CShapeTransaction<CCircle>
{
..
};
class CRemoveCircleTrasaction : public CShapeTransaction<CCircle>
{
..
};