Skip to content

Commit

Permalink
Merge pull request #2 from corigan01/MethodDeterminedSystems
Browse files Browse the repository at this point in the history
Method determined systems
  • Loading branch information
corigan01 authored Apr 29, 2020
2 parents d1fd465 + 4c66693 commit 7d5d971
Show file tree
Hide file tree
Showing 19 changed files with 1,450 additions and 161 deletions.
68 changes: 14 additions & 54 deletions CrossSockets/Base.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
#include <cstdio>
#include <sstream>
#include <algorithm>
#include <excpt.h>


using namespace std::this_thread; // sleep_for, sleep_until
using namespace std::chrono; // nanoseconds, system_clock, seconds


#ifdef _WIN32
Expand All @@ -59,62 +64,18 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
#endif // _WIN32

#ifdef __linux

#error "Linux is not suppored yet, we still use chrono for timing :("
#endif // __linux


using std::cout;
using std::endl;

#define EOR std::cout << "[DEBUGING USE ONLY] PASSED LINE: " << __LINE__ << std::endl;

#ifndef _STD
#define _STD ::std::
#endif // !_STD

// Defines the color output for the console
namespace ColorM {
enum Code {
FG_RED = 31,
FG_GREEN = 32,
FG_BLUE = 34,
FG_YELLOW = 33,
FG_DEFAULT = 39,
FG_MAGENTA = 35,
BG_RED = 41,
BG_GREEN = 42,
BG_BLUE = 44,
BG_DEFAULT = 49

};
class Modifier {
Code code;
public:
Modifier(Code pCode) : code(pCode) {}
friend std::ostream&
operator<<(std::ostream& os, const Modifier& mod) {
return os << "\033[" << mod.code << "m";
}
};
}
ColorM::Modifier redM(ColorM::FG_RED);
ColorM::Modifier greenM(ColorM::FG_GREEN);
ColorM::Modifier blueM(ColorM::FG_BLUE);
ColorM::Modifier magentaM(ColorM::FG_MAGENTA);
ColorM::Modifier yellowM(ColorM::FG_YELLOW);
ColorM::Modifier defM(ColorM::FG_DEFAULT);

// defines the log types for outputting
enum Debug
{
D_LOG = 1,
D_FILE,
D_DEBUG,
D_ERROR,
D_INFO,
D_WARNING,
};

_STD string debugstring[] = { "NULL", "LOG", "FILE", "DEBUG", "ERROR", "INFO", "WARNING" };
ColorM::Modifier debugcolor[] = { defM, blueM, greenM, redM, redM, magentaM, yellowM };


// displays out the log
Expand All @@ -134,13 +95,12 @@ ColorM::Modifier debugcolor[] = { defM, blueM, greenM, redM, redM, magentaM, yel
}*/

// Defining Helpful macros
#define FOR(varname, iterations) for (int varname = 0; varname < iterations; varname++)
#define xstr(x) str(x)
#define str(x) #x
#define glue(x, y) x ## y


struct Server
{
std::string IP = "127.0.0.1";
int InBoundPort = 56010;
int OutBound = 56050;
};


#endif // !Template
Loading

0 comments on commit 7d5d971

Please sign in to comment.