MASA-Core
MasaNetStatus.hpp
Go to the documentation of this file.
00001 /*******************************************************************************
00002  *
00003  * Copyright (c) 2010-2015   Edans Sandes
00004  *
00005  * This file is part of MASA-Core.
00006  * 
00007  * MASA-Core is free software: you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License as published by
00009  * the Free Software Foundation, either version 3 of the License, or
00010  * (at your option) any later version.
00011  * 
00012  * MASA-Core is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  * 
00017  * You should have received a copy of the GNU General Public License
00018  * along with MASA-Core.  If not, see <http://www.gnu.org/licenses/>.
00019  *
00020  ******************************************************************************/
00021 
00022 class MasaNetStatus;
00023 
00024 #ifndef MASANETSTATUS_HPP_
00025 #define MASANETSTATUS_HPP_
00026 
00027 #include "../libmasa/libmasaTypes.hpp"
00028 #include <pthread.h>
00029 #include <string>
00030 using namespace std;
00031 
00032 /* LibMasa Server State */
00033 #define SERVER_SHUTDOWN         (0)
00034 #define SERVER_LISTENING        (1)
00035 
00036 /* Processing State */
00037 #define STATE_IDLE                      (0)
00038 #define STATE_CREATING_RING     (1)
00039 #define STATE_READY                     (2)
00040 #define STATE_STARTING          (3)
00041 #define STATE_PROCESSING        (4)
00042 #define STATE_FINISHING         (5)
00043 
00044 class MasaNetStatus {
00045 public:
00046         MasaNetStatus();
00047         virtual ~MasaNetStatus();
00048 
00049         void copyFrom(MasaNetStatus* status);
00050 
00051         const score_t& getBestScore();
00052         void setBestScore(const score_t& bestScore);
00053 
00054         int getLastProcessedRow() const;
00055         void setLastProcessedRow(int lastProcessedRow);
00056 
00057 
00058         int getProcessingState() const;
00059         void setProcessingState(int processingState);
00060 
00061         int getServerState() const;
00062         void setServerState(int serverState);
00063 
00064         string toString();
00065 
00066 private:
00067         int serverState;
00068         int processingState;
00069 
00070         int lastProcessedRow;
00071         score_t bestScore;
00072 };
00073 
00074 #endif /* MASANETSTATUS_HPP_ */