|
|
@@ -17,7 +17,7 @@ |
|
|
|
#include <string> |
|
|
|
#include <set> |
|
|
|
|
|
|
|
using namespace std; |
|
|
|
namespace cd = codedweller; |
|
|
|
|
|
|
|
const unsigned long int HeaderDirectiveBypass = 0x00000001; // Bypass hd rule flag. |
|
|
|
const unsigned long int HeaderDirectiveWhite = 0x00000002; // White hd rule flag. |
|
|
@@ -25,12 +25,12 @@ const unsigned long int HeaderDirectiveDrillDown = 0x00000004; |
|
|
|
const unsigned long int HeaderDirectiveSource = 0x00000008; // Source rule flag. |
|
|
|
const unsigned long int HeaderDirectiveContext = 0x80000000; // Context activation flag. |
|
|
|
|
|
|
|
class HeaderDirectiveHandler : public Configurator { // Handle inputs to header directives. |
|
|
|
class HeaderDirectiveHandler : public cd::Configurator { // Handle inputs to header directives. |
|
|
|
public: |
|
|
|
|
|
|
|
HeaderDirectiveSet HeaderDirectives; // Managed set of Header Directives. |
|
|
|
|
|
|
|
void operator()(ConfigurationElement& E, ConfigurationData& D) { // The configurator call adds the Input. |
|
|
|
void operator()(cd::ConfigurationElement& E, cd::ConfigurationData& D) { // The configurator call adds the Input. |
|
|
|
|
|
|
|
if(HeaderDirectiveContext == ContextInput.Directive) { // If a context has been established |
|
|
|
ContextInput.Context = HeaderDirectives.size() + 1; // then setup the context ID and |
|
|
@@ -54,7 +54,7 @@ class HeaderDirectiveHandler : public Configurator { |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
class HeaderDirectiveInitializer : public Configurator { // Initializes Header Directives. |
|
|
|
class HeaderDirectiveInitializer : public cd::Configurator { // Initializes Header Directives. |
|
|
|
private: |
|
|
|
|
|
|
|
HeaderDirectiveHandler* MyTarget; // Needs to know it's target. |
|
|
@@ -65,14 +65,14 @@ class HeaderDirectiveInitializer : public Configurator { |
|
|
|
|
|
|
|
void setTarget(HeaderDirectiveHandler& H) { MyTarget = &H; } // We have a way to set the target though ;-) |
|
|
|
|
|
|
|
void operator()(ConfigurationElement& E, ConfigurationData& D) { // The configurator() function goes to the |
|
|
|
void operator()(cd::ConfigurationElement& E, cd::ConfigurationData& D) { // The configurator() function goes to the |
|
|
|
if(NULL!=MyTarget) { // target (if it's set) and pushes the |
|
|
|
MyTarget->reset(); // reset button (empties the set). |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
class HeaderDirectiveWhiteHeaderInitializer : public Configurator { // Initializes White Header Directives. |
|
|
|
class HeaderDirectiveWhiteHeaderInitializer : public cd::Configurator { // Initializes White Header Directives. |
|
|
|
private: |
|
|
|
|
|
|
|
HeaderDirectiveHandler* MyTarget; // Needs to know it's target. |
|
|
@@ -83,7 +83,7 @@ class HeaderDirectiveWhiteHeaderInitializer : public Configurator { |
|
|
|
|
|
|
|
void setTarget(HeaderDirectiveHandler& H) { MyTarget = &H; } // We have a way to set the target though ;-) |
|
|
|
|
|
|
|
void operator()(ConfigurationElement& E, ConfigurationData& D) { // The configurator() function goes to the |
|
|
|
void operator()(cd::ConfigurationElement& E, cd::ConfigurationData& D) { // The configurator() function goes to the |
|
|
|
if(NULL!=MyTarget) { // target (if it's set) and sets it up |
|
|
|
MyTarget->ContextInput.clear(); // for a white header directive. |
|
|
|
MyTarget->DirectiveInput.clear(); |
|
|
@@ -92,7 +92,7 @@ class HeaderDirectiveWhiteHeaderInitializer : public Configurator { |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
class HeaderDirectiveBypassHeaderInitializer : public Configurator { // Initializes Bypass Header Directives. |
|
|
|
class HeaderDirectiveBypassHeaderInitializer : public cd::Configurator { // Initializes Bypass Header Directives. |
|
|
|
private: |
|
|
|
|
|
|
|
HeaderDirectiveHandler* MyTarget; // Needs to know it's target. |
|
|
@@ -103,7 +103,7 @@ class HeaderDirectiveBypassHeaderInitializer : public Configurator { |
|
|
|
|
|
|
|
void setTarget(HeaderDirectiveHandler& H) { MyTarget = &H; } // We have a way to set the target though ;-) |
|
|
|
|
|
|
|
void operator()(ConfigurationElement& E, ConfigurationData& D) { // The configurator() function goes to the |
|
|
|
void operator()(cd::ConfigurationElement& E, cd::ConfigurationData& D) { // The configurator() function goes to the |
|
|
|
if(NULL!=MyTarget) { // target (if it's set) and sets it up |
|
|
|
MyTarget->ContextInput.clear(); // for a bypass header directive. |
|
|
|
MyTarget->DirectiveInput.clear(); |
|
|
@@ -112,7 +112,7 @@ class HeaderDirectiveBypassHeaderInitializer : public Configurator { |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
class HeaderDirectiveDrilldownInitializer : public Configurator { // Initializes Drilldown Header Directives. |
|
|
|
class HeaderDirectiveDrilldownInitializer : public cd::Configurator { // Initializes Drilldown Header Directives. |
|
|
|
private: |
|
|
|
|
|
|
|
HeaderDirectiveHandler* MyTarget; // Needs to know it's target. |
|
|
@@ -123,7 +123,7 @@ class HeaderDirectiveDrilldownInitializer : public Configurator { |
|
|
|
|
|
|
|
void setTarget(HeaderDirectiveHandler& H) { MyTarget = &H; } // We have a way to set the target though ;-) |
|
|
|
|
|
|
|
void operator()(ConfigurationElement& E, ConfigurationData& D) { // The configurator() function goes to the |
|
|
|
void operator()(cd::ConfigurationElement& E, cd::ConfigurationData& D) { // The configurator() function goes to the |
|
|
|
if(NULL!=MyTarget) { // target (if it's set) and sets it up for |
|
|
|
MyTarget->ContextInput.clear(); // a drilldown header directive. |
|
|
|
MyTarget->DirectiveInput.clear(); |
|
|
@@ -133,7 +133,7 @@ class HeaderDirectiveDrilldownInitializer : public Configurator { |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
class HeaderDirectiveSourceHeaderInitializer : public Configurator { // Initializes Source Header Directives. |
|
|
|
class HeaderDirectiveSourceHeaderInitializer : public cd::Configurator { // Initializes Source Header Directives. |
|
|
|
private: |
|
|
|
|
|
|
|
HeaderDirectiveHandler* MyTarget; // Needs to know it's target. |
|
|
@@ -144,7 +144,7 @@ class HeaderDirectiveSourceHeaderInitializer : public Configurator { |
|
|
|
|
|
|
|
void setTarget(HeaderDirectiveHandler& H) { MyTarget = &H; } // We have a way to set the target though ;-) |
|
|
|
|
|
|
|
void operator()(ConfigurationElement& E, ConfigurationData& D) { // The configurator() function goes to the |
|
|
|
void operator()(cd::ConfigurationElement& E, cd::ConfigurationData& D) { // The configurator() function goes to the |
|
|
|
if(NULL!=MyTarget) { // target (if it's set) and sets it up |
|
|
|
MyTarget->ContextInput.clear(); // for a context sensitive source header |
|
|
|
MyTarget->DirectiveInput.clear(); // directive. Activation context as well |
|
|
@@ -186,10 +186,10 @@ class RangePoint { |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
class RangeHandler : public Configurator { // The handler adds edgepoints and holds and |
|
|
|
class RangeHandler : public cd::Configurator { // The handler adds edgepoints and holds and |
|
|
|
public: // tests the set that defines the region. |
|
|
|
|
|
|
|
void operator()(ConfigurationElement& E, ConfigurationData& D) { // The () operator adds EdgeInput to the list. |
|
|
|
void operator()(cd::ConfigurationElement& E, cd::ConfigurationData& D) { // The () operator adds EdgeInput to the list. |
|
|
|
EdgeMap.insert(EdgeInput); |
|
|
|
} |
|
|
|
|
|
|
@@ -207,7 +207,7 @@ class RangeHandler : public Configurator { |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
class RangeInitializer : public Configurator { // The RangeInitializer Configurator. |
|
|
|
class RangeInitializer : public cd::Configurator { // The RangeInitializer Configurator. |
|
|
|
private: |
|
|
|
|
|
|
|
RangeHandler* MyTarget; // Needs to know it's target. |
|
|
@@ -218,16 +218,16 @@ class RangeInitializer : public Configurator { |
|
|
|
|
|
|
|
void setTarget(RangeHandler& H) { MyTarget = &H; } // We have a way to set the target though ;-) |
|
|
|
|
|
|
|
void operator()(ConfigurationElement& E, ConfigurationData& D) { // The configurator() function goes to the |
|
|
|
void operator()(cd::ConfigurationElement& E, cd::ConfigurationData& D) { // The configurator() function goes to the |
|
|
|
if(NULL!=MyTarget) { // target (if it's set) and pushes the |
|
|
|
MyTarget->reset(); // reset button. |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
class IntegerSetHandler : public Configurator { // Integer set handler for rule panics. |
|
|
|
class IntegerSetHandler : public cd::Configurator { // Integer set handler for rule panics. |
|
|
|
public: |
|
|
|
void operator()(ConfigurationElement& E, ConfigurationData& D) { // The operator() inserts IntegerInput |
|
|
|
void operator()(cd::ConfigurationElement& E, cd::ConfigurationData& D) { // The operator() inserts IntegerInput |
|
|
|
IntegerSet.insert(IntegerInput); // if it's not already a member. |
|
|
|
} |
|
|
|
|
|
|
@@ -239,7 +239,7 @@ class IntegerSetHandler : public Configurator { |
|
|
|
void reset() { IntegerSet.clear(); } // How to reset (clear) the list. |
|
|
|
}; |
|
|
|
|
|
|
|
class IntegerSetInitializer : public Configurator { // The initializer resets the set. |
|
|
|
class IntegerSetInitializer : public cd::Configurator { // The initializer resets the set. |
|
|
|
private: |
|
|
|
|
|
|
|
IntegerSetHandler* MyTarget; // It needs to know which set to init. |
|
|
@@ -250,7 +250,7 @@ class IntegerSetInitializer : public Configurator { |
|
|
|
|
|
|
|
void setTarget(IntegerSetHandler& H) { MyTarget = &H; } // Set a pointer to the handler. |
|
|
|
|
|
|
|
void operator()(ConfigurationElement& E, ConfigurationData& D) { // The operator() does the trick. |
|
|
|
void operator()(cd::ConfigurationElement& E, cd::ConfigurationData& D) { // The operator() does the trick. |
|
|
|
if(NULL!=MyTarget) { |
|
|
|
MyTarget->reset(); |
|
|
|
} |
|
|
@@ -270,7 +270,7 @@ class XHDRSymbol { |
|
|
|
} // in this case. |
|
|
|
}; |
|
|
|
|
|
|
|
class XHDRSymbolsHandler : public Configurator { // XHDRSymbol hander. |
|
|
|
class XHDRSymbolsHandler : public cd::Configurator { // XHDRSymbol hander. |
|
|
|
public: |
|
|
|
set<XHDRSymbol> SymbolHeaders; // Carries a set of Symbol Headers. |
|
|
|
|
|
|
@@ -289,14 +289,14 @@ class XHDRSymbolsHandler : public Configurator { |
|
|
|
int Symbol; // Input Symbol value. |
|
|
|
string Header; // Input Header value. |
|
|
|
|
|
|
|
void operator()(ConfigurationElement& E, ConfigurationData& D) { // The operator() inserts an XHDRSymbol |
|
|
|
void operator()(cd::ConfigurationElement& E, cd::ConfigurationData& D) { // The operator() inserts an XHDRSymbol |
|
|
|
if(OnOff) { // if the header entry is turned on and |
|
|
|
SymbolHeaders.insert(XHDRSymbol(Symbol, Header)); // if it's not already a member. |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
class XHDRSymbolsInitializer : public Configurator { // The XHDRSymbols initializer. |
|
|
|
class XHDRSymbolsInitializer : public cd::Configurator { // The XHDRSymbols initializer. |
|
|
|
private: |
|
|
|
|
|
|
|
XHDRSymbolsHandler* MyTarget; // It needs to know which set to init. |
|
|
@@ -307,7 +307,7 @@ class XHDRSymbolsInitializer : public Configurator { |
|
|
|
|
|
|
|
void setTarget(XHDRSymbolsHandler& H) { MyTarget = &H; } // Set a pointer to the handler. |
|
|
|
|
|
|
|
void operator()(ConfigurationElement& E, ConfigurationData& D) { // The operator() does the trick. |
|
|
|
void operator()(cd::ConfigurationElement& E, cd::ConfigurationData& D) { // The operator() does the trick. |
|
|
|
if(NULL!=MyTarget) { |
|
|
|
MyTarget->reset(); |
|
|
|
} |
|
|
@@ -336,7 +336,7 @@ const int LogOutputMode_Inject = 3; |
|
|
|
class snfCFGData { // Object that stores our config data. |
|
|
|
private: |
|
|
|
|
|
|
|
ConfigurationElement MyCFGReader; // This is how we read our cfg data. |
|
|
|
cd::ConfigurationElement MyCFGReader; // This is how we read our cfg data. |
|
|
|
|
|
|
|
public: |
|
|
|
|