void NMEAEndpoint::initialize(){
    CommandEndpoint::initialize();
    registerBoolCmd("input","Input mode", "When on, messages are forwarded to the Server, otherwise messages are discarded.",  &input, true, true);
    registerBoolCmd("output", "Output mode", "When on, messages comming from the Server are sent to the remote end, otherwise messages are discarded.", &output, true, true);
    registerBoolCmd("mirror", "Mirror mode", "When on, messages comming from the Server are sent to the remote end even if they were originally coming from there", &portmirror, false, true);
    registerBoolCmd("checksum", "Print checksums", "When on, messages are sent with their checksum (*XX)", &checksum, true, true);
    registerBoolCmd("force_checksum", "Force checksum check", "When on, messages are checked against their checksum (*XX)", &check_checksum, false, true);
    registerIntCmd("incompress","Input Compressor Number", "Defines the maximum number of consecutive incoming messages that are compressed. 0 = no compresson; -1 = infinite compression", &incompress_messages, 0, -1, std::numeric_limits<int>::max(), true);
    registerIntCmd("outcompress","Output Compressor Number", "Defines the maximum number of consecutive outgoing messages that are compressed. 0 = no compresson; -1 = infinite compression", &outcompress_messages, 0, -1, std::numeric_limits<int>::max(), true);
    
    registerStringVectorCmd("in_black","Incoming Blacklist", "Define Message-Ids of incoming messages that should be dropped. You can use * for generalization (e.g. GS* to match GSV and GSL).",  &in_black, true);
    registerStringVectorCmd("in_white","Incoming Whitelist", "Define Message-Ids of incoming messages that should never be dropped. You can use * for generalization (e.g. GS* to match GSV and GSL).",  &in_white, true);
    registerStringVectorCmd("out_black","Outgoing Blacklist", "Define Message-Ids of outgoing messages that should be dropped. You can use * for generalization (e.g. GS* to match GSV and GSL).",  &out_black, true);
    registerStringVectorCmd("out_white","Outgoing Whitelist", "Define Message-Ids of outgoing messages that should never be dropped. You can use * for generalization (e.g. GS* to match GSV and GSL).",  &out_white, true);
    registerBoolCmd("stats", "Statistics", "When on, stats are calculated", &stats_enabled, false, true);
    boost::function<void (Command_ptr)> func = boost::bind(&NMEAEndpoint::print_stats_cmd, this, _1);
    registerVoidCmd("print_stats","Print statistics", "Prints the statistics when enabled. See also [stats] command",  func);
    //boost::function<void (Command_ptr)> func = boost::bind(&NMEAEndpoint::add_midpoint_cmd, this, _1);
    //registerVoidCmd("add_midpoint","Midpoint hinzufügen", "Add a midpoint and connect it between this endpoint and the Endpoint it is connected to. Midpoint type and arguments must be passed.",  func);
    stat_list_size=60;
    in_total_size=0;
    out_total_size=0;
    in_msg_from_start=0;
    in_byte_from_start=0;
    out_msg_from_start=0;
    out_byte_from_start=0;
}
void FileEndpoint::initialize(){
    NMEAEndpoint::initialize();
    registerIntCmd("min_available","Minimimum remaining disk space", "Defines the minimum remaining disk space that should be left. When there is not enough space on the disk hosting this file, nothing is written. 0 = nocheck", &min_available_mbs, 0, 0, std::numeric_limits<int>::max(), true);
    boost::function<void (Command_ptr)> func = boost::bind(&FileEndpoint::space_left_cmd, this, _1);
    registerVoidCmd("space_left","Print Space left", "Prints the space left on the disk",  func);
    func = boost::bind(&FileEndpoint::seek_cmd, this, _1);
    registerVoidCmd("seek","Seek position in log", "Put playback position at time.",  func);
    registerBoolCmd("record_answer","Record answers", "When on, answers are recorded to the file aswell.",  &record_answers, false, true);
    registerStringCmd("timestamp_format", "Format of the timestamp for messages", "Defines how the timestamp in front of each message is formated. Default is: \"%Y-%m-%d %H:%M:%s\" ", &timestamp_format, "%Y-%m-%d %H:%M:%s ", true);
    registerUIntCmd("speedup","Speedup factor for playback", "Defines the factor for speedup of playback", &speedup, 1, 1, 1000, true);
    
    registerEndpoint();
}
template<class T> void AsyncEndpoint<T>::initialize(){
    NMEAEndpoint::initialize();
    
    registerBoolCmd("persist" ,"Session persistance", "When on, messages are stored after a disconnect and after the reconnect replayed. See also [queue_size]", &persist, false, true);
    registerUIntCmd("queue_size","Message Queue Size", "Defines the maximum size of the message queue for this endpoint. See also [persist]", &message_queue_size, 10, 0, std::numeric_limits<unsigned int>::max(), true);
    boost::function<void (Command_ptr)> func = boost::bind(&AsyncEndpoint<T>::exit_cmd, this, _1);
    registerVoidCmd("exit","End Session", "Ends the session and disconnects the remote host. Command does not take any arguments.",  func);
    unregisterCmd("print_stats");
    boost::function<void (Command_ptr)> func2 = boost::bind(&AsyncEndpoint<T>::print_stats_cmd, this, _1);
    registerVoidCmd("print_stats","Print Session statistics", "Prints statistics about the session.",  func2);
    isActive=false;
    wasFull = false;
}