Browse Source

cleaned up namespace in snf_sync

master
Pete McNeil 4 years ago
parent
commit
4c1b2b4653
1 changed files with 6 additions and 4 deletions
  1. 6
    4
      snf_sync.cpp

+ 6
- 4
snf_sync.cpp View File

@@ -5,6 +5,8 @@

#include "snf_sync.hpp"

namespace cd = codedweller;

void snf_sync::construct() { // Encapsulate initial construction.
ClientGBUAlertInitializer.link(ClientGBUAlertHandler); // Link the alert configurators.
ServerGBUAlertInitializer.link(ServerGBUAlertHandler);
@@ -23,7 +25,7 @@ snf_sync::snf_sync(const char* bfr, int len) :
Reader("snf"), // Start with our blank construction.
ReadWasGood(false) {
construct(); // Internal wiring & initialization.
ConfigurationData Data(bfr, len); // Then build ConfigurationData from
cd::ConfigurationData Data(bfr, len); // Then build ConfigurationData from
Reader.interpret(Data); // the buffer and interpret it.
}

@@ -31,7 +33,7 @@ snf_sync::snf_sync(string& input) :
Reader("snf"), // Start with our blank construction.
ReadWasGood(false) {
construct(); // Internal wiring & initialization.
ConfigurationData Data(input.c_str(), input.length()); // Then build ConfigurationData from
cd::ConfigurationData Data(input.c_str(), input.length()); // Then build ConfigurationData from
Reader.interpret(Data); // the string and interpret it.
}

@@ -89,7 +91,7 @@ void snf_sync::reset() {
};

bool snf_sync::read(const char* bfr, int len) { // To read from a buffer we
ConfigurationData Data(bfr, len); // construct ConfigurationData from
cd::ConfigurationData Data(bfr, len); // construct ConfigurationData from
Reader.interpret(Data); // the buffer and interpret it.
return good(); // Return true if it looked good.
}
@@ -107,7 +109,7 @@ bool snf_sync::bad() {
}

void GBUAlertHandler::operator()(
ConfigurationElement& E, ConfigurationData& D) { // Add an alert.
cd::ConfigurationElement& E, cd::ConfigurationData& D) { // Add an alert.
GBUdbAlert NewAlert; // Create an alert object.
SocketAddress IPAddress; // Grab one of these for a converter.
IPAddress.setAddress(const_cast<char*>(Alert_ip.c_str())); // Conver the IP address to an int.

Loading…
Cancel
Save