AppCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
EAdvertisementReaderWriter.h
Go to the documentation of this file.
1 #ifndef E_ADVERTISEMENT_READER_WRITER_H
2 #define E_ADVERTISEMENT_READER_WRITER_H
3 
4 #include "EAdvertisement.h"
5 #include <string>
6 using namespace std;
7 
8 #define _BSD_COMPAT
9 #include <sys/file.h>
10 #include <unistd.h>
11 #include <errno.h>
12 
14 {
18 };
19 
21 {
22  SHARED_LOCK = 0, // zdielany zamok
23  EXCLUSIVE_LOCK = 1 // exkluzivny zamok
24 };
25 
27 {
28 public:
29  static long WriteDisplayCount( EAdvertisement* advertisement, unsigned long busstopID, unsigned long deviceSNR );
30 
31  static ELockResult Lock( string fileName, LockType lockType, unsigned short lockTryCount, unsigned long lockTryWait, int& fileDescriptor );
32 
33  static long UnLock( int fileDescriptor );
34 
36 
37 private:
38  static string GetFileName( unsigned long advertisementID, unsigned long deviceSNR );
39 };
40 
41 #endif //E_ADVERTISEMENT_READER_WRITER_H
ELockResult
Definition: EAdvertisementReaderWriter.h:13
Definition: EAdvertisementReaderWriter.h:16
Definition: EAdvertisement.h:18
Definition: EAdvertisementReaderWriter.h:26
Definition: EAdvertisementReaderWriter.h:15
LockType
Definition: EAdvertisementReaderWriter.h:20
Definition: EAdvertisementReaderWriter.h:22
Definition: EAdvertisementReaderWriter.h:23
Definition: EAdvertisementReaderWriter.h:17