|
#ifndef MetaModelUtilities_H
#define MetaModelUtilities_H
#include <Model/CppTagModel.h>
#include <Utilities/smart_ptr.h>
#include <list>
#include <map>
#include <functional>
class RootFinder
{
public:
typedef std::map<size_t, std::list<smart_ptr<Inheritable> > > RootMap;
public:
RootMap findRootOf(const smart_ptr<Inheritable>&);
};
struct IsRelativeOf : public std::binary_function<smart_ptr<Inheritable>, smart_ptr<Inheritable>, bool>
{
bool operator()(const smart_ptr<Inheritable> &r1, const smart_ptr<Inheritable> &r2) const;
static bool isParentOf(const smart_ptr<Inheritable> &parent, const smart_ptr<Inheritable> &child);
static bool isExtendorOf(const smart_ptr<Inheritable> &child, const smart_ptr<Inheritable> &parent);
};
struct hash_comperator : public std::binary_function<const CppTag*, smart_ptr<CppTag>, bool>
{
bool operator()(first_argument_type t1, const smart_ptr<CppTag>& t2) const
{
return t1->hash(true) == t2->hash(true);
}
};
template<class T>
struct AccessSorter : public std::binary_function<smart_ptr<T>,smart_ptr<T>,bool>
{
bool operator()(const first_argument_type &lhs, const second_argument_type &rhs) const
{ return lhs->getAccessQualifier() < rhs->getAccessQualifier(); }
};
template<class T>
struct NameSorter : public std::binary_function<smart_ptr<T>,smart_ptr<T>,bool>
{
bool operator()(const first_argument_type &lhs, const second_argument_type &rhs) const
{ return lhs->getName() < rhs->getName(); }
};
template<class T>
struct FQNSorter : public std::binary_function<smart_ptr<T>,smart_ptr<T>,bool>
{
bool operator()(const first_argument_type &lhs, const second_argument_type &rhs) const
{ return lhs->getFQN().toString() < rhs->getFQN().toString(); }
};
template<class T>
struct FQNComperator : public std::binary_function<smart_ptr<T>,smart_ptr<T>,bool>
{
bool operator()(const first_argument_type &lhs, const second_argument_type &rhs) const
{ return lhs->getFQN().toString() == rhs->getFQN().toString(); }
};
#endif
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.