ARB
TreeLabeler.h
Go to the documentation of this file.
1 // ========================================================= //
2 // //
3 // File : TreeLabeler.h //
4 // Purpose : Generate labels for TreeNode //
5 // //
6 // Coded by Ralf Westram (coder@reallysoft.de) in Aug 21 //
7 // http://www.arb-home.de/ //
8 // //
9 // ========================================================= //
10 
11 #ifndef TREELABELER_H
12 #define TREELABELER_H
13 
14 // -----------------------------------------
15 // TreeLabeler and specialisations
16 
17 struct TreeLabeler {
18  virtual ~TreeLabeler() {}
19 
20  virtual const char *speciesLabel(GBDATA *gb_main, GBDATA *gb_species, TreeNode *species, const char *tree_name) const = 0;
21  virtual const char *groupLabel (GBDATA *gb_main, GBDATA *gb_group, TreeNode *species, const char *tree_name) const = 0;
22 };
23 
24 struct Node_ID_Labeler : public TreeLabeler {
25  // simply returns the 'name' of the node
26  // (=species ID if !zombie; zombie ID; group ID or NULp for inner nodes which are no group)
27 
28  const char *speciesLabel(GBDATA *, GBDATA *, TreeNode *species, const char *) const OVERRIDE;
29  const char *groupLabel(GBDATA *, GBDATA *, TreeNode *species, const char *) const OVERRIDE;
30 };
31 
32 
33 
34 #else
35 #error TreeLabeler.h included twice
36 #endif // TREELABELER_H
virtual ~TreeLabeler()
Definition: TreeLabeler.h:18
virtual const char * speciesLabel(GBDATA *gb_main, GBDATA *gb_species, TreeNode *species, const char *tree_name) const =0
virtual const char * groupLabel(GBDATA *gb_main, GBDATA *gb_group, TreeNode *species, const char *tree_name) const =0
const char * speciesLabel(GBDATA *, GBDATA *, TreeNode *species, const char *) const OVERRIDE
Definition: TreeWrite.cxx:33
const char * groupLabel(GBDATA *, GBDATA *, TreeNode *species, const char *) const OVERRIDE
Definition: TreeWrite.cxx:36
#define OVERRIDE
Definition: cxxforward.h:112
GBDATA * gb_main
Definition: adname.cxx:32