debug.cc (9554:406fbcf60223) debug.cc (11153:20bbfe5b2b86)
1/*
2 * Copyright (c) 2003-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

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

63int allFlagsVersion = 0;
64FlagsMap &
65allFlags()
66{
67 static FlagsMap flags;
68 return flags;
69}
70
1/*
2 * Copyright (c) 2003-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

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

63int allFlagsVersion = 0;
64FlagsMap &
65allFlags()
66{
67 static FlagsMap flags;
68 return flags;
69}
70
71bool SimpleFlag::_active = false;
72
71Flag *
72findFlag(const std::string &name)
73{
74 FlagsMap::iterator i = allFlags().find(name);
75 if (i == allFlags().end())
76 return NULL;
77 return i->second;
78}

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

90}
91
92Flag::~Flag()
93{
94 // should find and remove flag.
95}
96
97void
73Flag *
74findFlag(const std::string &name)
75{
76 FlagsMap::iterator i = allFlags().find(name);
77 if (i == allFlags().end())
78 return NULL;
79 return i->second;
80}

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

92}
93
94Flag::~Flag()
95{
96 // should find and remove flag.
97}
98
99void
100SimpleFlag::enableAll()
101{
102 _active = true;
103 for (auto& i : allFlags())
104 i.second->sync();
105}
106
107void
108SimpleFlag::disableAll()
109{
110 _active = false;
111 for (auto& i : allFlags())
112 i.second->sync();
113}
114
115void
98CompoundFlag::enable()
99{
116CompoundFlag::enable()
117{
100 SimpleFlag::enable();
101 for_each(_kids.begin(), _kids.end(), mem_fun(&Flag::enable));
118 for (auto& k : _kids)
119 k->enable();
102}
103
104void
105CompoundFlag::disable()
106{
120}
121
122void
123CompoundFlag::disable()
124{
107 SimpleFlag::disable();
108 for_each(_kids.begin(), _kids.end(), mem_fun(&Flag::disable));
125 for (auto& k : _kids)
126 k->disable();
109}
110
111struct AllFlags : public Flag
112{
113 AllFlags()
114 : Flag("All", "All Flags")
115 {}
116

--- 66 unchanged lines hidden ---
127}
128
129struct AllFlags : public Flag
130{
131 AllFlags()
132 : Flag("All", "All Flags")
133 {}
134

--- 66 unchanged lines hidden ---