Initial
This commit is contained in:
47
imagelst/RELATION.HPP
Normal file
47
imagelst/RELATION.HPP
Normal file
@@ -0,0 +1,47 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user