Simple Geolocalization and Course Transmission Protocol (SGCTP)
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros Pages
transmit_file.hpp
Go to the documentation of this file.
1 // INDENTING (emacs/vi): -*- mode:c++; tab-width:2; c-basic-offset:2; intent-tabs-mode:nil; -*- ex: set tabstop=2 expandtab:
2 
3 /*
4  * Simple Geolocalization and Course Transmission Protocol (SGCTP)
5  * Copyright (C) 2014 Cedric Dufour <http://cedric.dufour.name>
6  *
7  * The Simple Geolocalization and Course Transmission Protocol (SGCTP) is
8  * free software:
9  * you can redistribute it and/or modify it under the terms of the GNU General
10  * Public License as published by the Free Software Foundation, Version 3.
11  *
12  * The Simple Geolocalization and Course Transmission Protocol (SGCTP) is
13  * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
14  * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
15  * PARTICULAR PURPOSE.
16  *
17  * See the GNU General Public License for more details.
18  */
19 
20 #ifndef SGCTP_CTRANSMIT_FILE_HPP
21 #define SGCTP_CTRANSMIT_FILE_HPP
22 
23 // SGCTP
24 #include "sgctp/transmit.hpp"
25 
26 
27 // SGCTP namespace
28 namespace SGCTP
29 {
30 
32 
35  class CTransmit_File: public CTransmit
36  {
37 
38  //----------------------------------------------------------------------
39  // CONSTRUCTORS / DESTRUCTOR
40  //----------------------------------------------------------------------
41 
42  public:
44  : CTransmit()
45  {};
46  virtual ~CTransmit_File()
47  {};
48 
49 
50  //----------------------------------------------------------------------
51  // METHODS: CTransmit (implement/override)
52  //----------------------------------------------------------------------
53 
54  protected:
55  virtual int send( int _iFileDescriptor,
56  const void *_pBuffer,
57  int _iSize,
58  int _iFlags );
59 
60  virtual int recv( int _iFileDescriptor,
61  void *_pBuffer,
62  int _iSize,
63  int _iFlags );
64 
65  public:
67  {
68  return TRANSMIT_FILE;
69  };
70 
71  virtual int alloc();
72 
73  };
74 
75 }
76 
77 #endif // SGCTP_CTRANSMIT_FILE_HPP
ETransmitType
Transmission types.
Definition: transmit.hpp:58
virtual int alloc()
Allocate resources required for data transmission (un-/serialization)
Generic transmission of SGCTP payload.
Definition: transmit.hpp:46
Save/load SGCTP payload to/from a file.
virtual ETransmitType getTransmitType()
Return the transmission type.
virtual int recv(int _iFileDescriptor, void *_pBuffer, int _iSize, int _iFlags)
Receive data from the given descriptor.
virtual int send(int _iFileDescriptor, const void *_pBuffer, int _iSize, int _iFlags)
Send data to the given descriptor.