Deleted Added
sdiff udiff text old ( 8232:b28d06a175be ) new ( 8269:5a9a639ce16f )
full compact
1/*
2 * Copyright (c) 2003-2005 The Regents of The University of Michigan
3 * Copyright (c) 2010 The Hewlett-Packard Development Company
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met: redistributions of source code must retain the above copyright

--- 30 unchanged lines hidden (view full) ---

39
40void breakpoint();
41
42class Flag
43{
44 protected:
45 const char *_name;
46 const char *_desc;
47
48 public:
49 Flag(const char *name, const char *desc);
50 virtual ~Flag();
51
52 std::string name() const { return _name; }
53 std::string desc() const { return _desc; }
54
55 virtual void enable() = 0;
56 virtual void disable() = 0;
57};
58
59class SimpleFlag : public Flag
60{
61 protected:

--- 10 unchanged lines hidden (view full) ---

72
73 void enable() { _status = true; }
74 void disable() { _status = false; }
75};
76
77class CompoundFlag : public SimpleFlag
78{
79 protected:
80 std::vector<Flag *> flags;
81
82 public:
83 CompoundFlag(const char *name, const char *desc,
84 Flag &f00 = *(Flag *)0, Flag &f01 = *(Flag *)0,
85 Flag &f02 = *(Flag *)0, Flag &f03 = *(Flag *)0,
86 Flag &f04 = *(Flag *)0, Flag &f05 = *(Flag *)0,
87 Flag &f06 = *(Flag *)0, Flag &f07 = *(Flag *)0,
88 Flag &f08 = *(Flag *)0, Flag &f09 = *(Flag *)0,

--- 5 unchanged lines hidden (view full) ---

94 : SimpleFlag(name, desc)
95 {
96 addFlag(f00); addFlag(f01); addFlag(f02); addFlag(f03); addFlag(f04);
97 addFlag(f05); addFlag(f06); addFlag(f07); addFlag(f08); addFlag(f09);
98 addFlag(f10); addFlag(f11); addFlag(f12); addFlag(f13); addFlag(f14);
99 addFlag(f15); addFlag(f16); addFlag(f17); addFlag(f18); addFlag(f19);
100 }
101
102 void
103 addFlag(Flag &f)
104 {
105 if (&f != NULL)
106 flags.push_back(&f);
107 }
108
109 void enable();
110 void disable();
111};
112
113} // namespace Debug
114
115#endif // __BASE_DEBUG_HH__