source: level2/competencies/MotionDirectionDetection/src/MessageStorage.h @ 322

Revision 322, 1.8 KB checked in by ginevra, 10 years ago (diff)
Line 
1// AUTHOR: Ginevra Castellano
2// Queen Mary University of London
3// DATE: 03/2010
4// VERSION: 1.0
5
6// Copyright (C) 2009 Ginevra Castellano
7// Queen Mary University of London
8
9// This file is part of the MotionDirectionDetection program
10
11// MotionDirectionDetection is free software: you can redistribute it and/or modify
12// it under the terms of the GNU Lesser General Public License as published by
13// the Free Software Foundation, either version 3 of the License, or
14// (at your option) any later version.
15
16// This program is distributed in the hope that it will be useful,
17// but WITHOUT ANY WARRANTY; without even the implied warranty of
18// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19// GNU Lesser General Public License for more details.
20
21// You should have received a copy of the GNU Lesser General Public License
22// along with this program.  If not, see <http://www.gnu.org/licenses/>.
23
24// MotionDirectionDetection uses the OpenCV library
25// Copyright (C) 2000-2006, Intel Corporation, all rights reserved.
26// Third party copyrights are property of their respective owners.
27// See OpenCV_license.txt, in the program folder, for details.
28
29
30#ifndef _MESSAGE_STORAGE
31#define _MESSAGE_STORAGE
32
33#include <vector>
34
35struct MessageInfo {
36        int messageCode;
37        double timeStamp;
38};
39
40class MessageStorage
41{
42        public:
43        MessageStorage(int maxListSize);
44        ~MessageStorage(void);
45
46        void addMessage(int messageCode, double timestamp);  // add latest message code and timestamp to a list
47                                                                                                                 // store the last N message codes and timestamps
48        MessageInfo* GetMessage(void);  // get latest message code and timestamp
49
50        private:
51        int currentMessageCode;
52
53        std::vector<MessageInfo*> messageList;
54        int maxListSize;
55       
56};
57#endif
Note: See TracBrowser for help on using the repository browser.