mirror of
https://github.com/isledecomp/SIEdit.git
synced 2024-11-27 09:35:45 -05:00
49 lines
1 KiB
C++
49 lines
1 KiB
C++
#ifndef CORE_H
|
|
#define CORE_H
|
|
|
|
#include <vector>
|
|
|
|
#include "common.h"
|
|
#include "types.h"
|
|
|
|
namespace si {
|
|
|
|
class Core
|
|
{
|
|
public:
|
|
Core();
|
|
LIBWEAVER_EXPORT virtual ~Core();
|
|
|
|
typedef std::vector<Core*> Children;
|
|
|
|
LIBWEAVER_EXPORT Core *GetParent() const { return parent_; }
|
|
LIBWEAVER_EXPORT const Children &GetChildren() const { return children_; }
|
|
|
|
bool FindParent(Core *p) const;
|
|
|
|
void AppendChild(Core *Core);
|
|
bool RemoveChild(Core *Core);
|
|
void InsertChild(size_t index, Core *Core);
|
|
Core *RemoveChild(size_t index);
|
|
|
|
LIBWEAVER_EXPORT size_t IndexOfChild(Core *Core) const;
|
|
LIBWEAVER_EXPORT Core *GetChildAt(size_t index) const { return children_.at(index); }
|
|
LIBWEAVER_EXPORT size_t GetChildCount() const { return children_.size(); }
|
|
LIBWEAVER_EXPORT bool HasChildren() const { return !children_.empty(); }
|
|
|
|
protected:
|
|
void DeleteChildren();
|
|
|
|
private:
|
|
// Disable copy
|
|
Core(const Core& other);
|
|
Core& operator=(const Core& other);
|
|
|
|
Core *parent_;
|
|
Children children_;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
#endif // CORE_H
|