00001 #ifndef __cmt_database_h__
00002 #define __cmt_database_h__
00003
00004 #include "cmt_vector.h"
00005
00006 #include "cmt_branch.h"
00007 #include "cmt_constituent.h"
00008 #include "cmt_fragment.h"
00009 #include "cmt_group.h"
00010 #include "cmt_language.h"
00011 #include "cmt_pattern.h"
00012 #include "cmt_tag.h"
00013 #include "cmt_use.h"
00014 #include "cmt_symbol.h"
00015
00016 class Database
00017 {
00018 public:
00019
00020 typedef enum
00021 {
00022 key_branch = 0x1,
00023 key_constituent = 0x2,
00024 key_fragment = 0x4,
00025 key_group = 0x8,
00026 key_language = 0x10,
00027 key_pattern = 0x20,
00028 key_selector = 0x40,
00029 key_tag = 0x80,
00030 key_use = 0x100,
00031 key_symbol = 0x200,
00032 key_all = 0xFFFF
00033 } keys;
00034
00035 static Database& instance ();
00036
00037 static void dump (const cmt_string& title, keys key_set = key_all);
00038 static void clear ();
00039
00040 static Branch::BranchVector& branches ();
00041 static Constituent::ConstituentVector& constituents ();
00042 static Fragment::FragmentVector& fragments ();
00043 static Group::GroupVector& groups ();
00044 static Language::LanguageVector& languages ();
00045 static Pattern::PatternVector& patterns ();
00046 static Tag::TagVector& all_tags ();
00047 static Tag::TagPtrVector& tags ();
00048 static Use::UseVector& all_uses ();
00049 static Use::UsePtrVector& uses ();
00050 static Symbol::SymbolVector& symbols ();
00051
00052 private:
00053
00054 Database ();
00055
00056 Branch::BranchVector m_branches;
00057 Constituent::ConstituentVector m_constituents;
00058 Fragment::FragmentVector m_fragments;
00059 Group::GroupVector m_groups;
00060 Language::LanguageVector m_languages;
00061 Pattern::PatternVector m_patterns;
00062 Tag::TagVector m_all_tags;
00063 Tag::TagPtrVector m_tags;
00064 Use::UseVector m_all_uses;
00065 Use::UsePtrVector m_uses;
00066 Symbol::SymbolVector m_symbols;
00067
00068 };
00069
00070 #endif