# AuditLine.hh

Go to the documentation of this file.

    00001 // ----------------------------------------------------------------------------
    00002 // CERTI - HLA RunTime Infrastructure
    00003 // Copyright (C) 2002-2005  ONERA
    00004 //
    00005 // This file is part of CERTI-libCERTI
    00006 //
    00007 // CERTI-libCERTI is free software ; you can redistribute it and/or
    00008 // modify it under the terms of the GNU Lesser General Public License
    00009 // as published by the Free Software Foundation ; either version 2 of
    00010 // the License, or (at your option) any later version.
    00011 //
    00012 // CERTI-libCERTI is distributed in the hope that it will be useful, but
    00013 // WITHOUT ANY WARRANTY ; without even the implied warranty of
    00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    00015 // Lesser General Public License for more details.
    00016 //
    00017 // You should have received a copy of the GNU Lesser General Public
    00018 // License along with this program ; if not, write to the Free Software
    00019 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
    00020 // USA
    00021 //
    00022 // $Id: AuditLine.hh,v 3.9 2005/04/30 16:48:25 breholee Exp $
    00023 // ----------------------------------------------------------------------------
    00024
    00025 #ifndef _CERTI_AUDIT_LINE_HH
    00026 #define _CERTI_AUDIT_LINE_HH
    00027
    00028 #include "certi.hh"
    00029 #include "Exception.hh"
    00030
    00031 #include <fstream>
    00032 #include <string>
    00033
    00034 namespace certi {
    00035
    00036 class AuditLine {
    00037
    00038 public:
    00039     AuditLine();
    00040     AuditLine(unsigned short, unsigned short, unsigned short, std::string);
    00041     ~AuditLine();
    00042
    00043     void write(std::ofstream &);
    00044     void addComment(const std::string &);
    00045     void end(unsigned short event_status = e_NO_EXCEPTION,
    00046          std::string reason = "");
    00047     unsigned short getLevel() const { return level ; };
    00048     unsigned short getStatus() const { return status ; };
    00049     bool started() const { return modified ; };
    00050     void setFederation(Handle h);
    00051     void setFederate(FederateHandle h);
    00052     void setLevel(unsigned short l);
    00053
    00054 private:
    00055     Handle federation ;
    00056     FederateHandle federate ;
    00057     unsigned short type ;
    00058     unsigned short level ;
    00059     unsigned short status ;
    00060     bool modified ;
    00061
    00062     time_t date ;
    00063     std::string comment ;
    00064 };
    00065
    00066 }
    00067
    00068 #endif // _CERTI_AUDIT_LINE_HH
    00069
    00070 // $Id: AuditLine.hh,v 3.9 2005/04/30 16:48:25 breholee Exp $