Files
Work/imagelst/RELATION.HPP
2024-08-07 09:16:27 -04:00

48 lines
1.2 KiB
C++

#ifndef _IMAGELST_RELATION_HPP_
#define _IMAGELST_RELATION_HPP_
#ifdef _EXPAND_RELATION_TEMPLATES_
#pragma option -Jgd
#endif
template <class T>
class RContainer
{
friend class Relation<T>;
public:
T *item(void);
void item(T *lpItem);
RContainer<T> *sibling(void);
void sibling(RContainer<T> *lpSibling);
RContainer<T> *parent(void);
void parent(RContainer<T> *lpParent);
RContainer<T> *child(void);
void child(RContainer<T> *lpChild);
private:
RContainer *mlpSibling;
RContainer *mlpParent;
RContainer *mlpChild;
T *mlpItem;
RContainer(void);
~RContainer();
};
template <class T>
class Relation
{
public:
Relation(void);
Relation(const Relation<T> &someRelation);
virtual ~Relation(void);
void insert(const T &someItem,const T &insertAfter);
void remove(const T &someItem);
WORD find(T &someItem);
Relation<T> &operator=(const Relation<T> &someRelation);
WORD operator==(const Relation<T> &someRelation)const;
private:
RContainer<T> *Relation<T>::searchChildDescend(RContainer<T> *lpRContainer,T &someItem);
RContainer<T> *Relation<T>::searchSiblingDescend(RContainer<T> *lpRContainer,T &someItem);
RContainer<T> *mlpRContainer;
};
#endif