CPPMyth
Library to interoperate with MythTV server
mythdto.h
1 /*
2  * Copyright (C) 2014 Jean-Luc Barriere
3  *
4  * This Program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2, or (at your option)
7  * any later version.
8  *
9  * This Program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; see the file COPYING. If not, write to
16  * the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
17  * MA 02110-1301 USA
18  * http://www.gnu.org/copyleft/gpl.html
19  *
20  */
21 
22 #ifndef MYTHDTO_H
23 #define MYTHDTO_H
24 
28 typedef enum
29 {
30  IS_STRING = 0,
31  IS_INT8,
32  IS_INT16,
33  IS_INT32,
34  IS_INT64,
35  IS_UINT8,
36  IS_UINT16,
37  IS_UINT32,
38  IS_DOUBLE,
39  IS_TIME,
40  IS_BOOLEAN,
41 } FT_t;
42 
43 
49 typedef void(*setter_t)(void *, const void *);
50 
55 typedef struct
56 {
57  const char *field;
58  FT_t type;
59  void(*set)(void *, const void *);
60 } attr_bind_t;
61 
66 typedef struct
67 {
68  int attr_count;
70 } bindings_t;
71 
76 namespace MythDTO
77 {
79  const bindings_t *getVersionBindArray(unsigned ranking);
81  const bindings_t *getListBindArray(unsigned proto);
83  const bindings_t *getChannelBindArray(unsigned proto);
85  const bindings_t *getRecordingBindArray(unsigned proto);
87  const bindings_t *getArtworkBindArray(unsigned proto);
89  const bindings_t *getProgramBindArray(unsigned proto);
91  const bindings_t *getCaptureCardBindArray(unsigned proto);
93  const bindings_t *getVideoSourceBindArray(unsigned proto);
95  const bindings_t *getRecordScheduleBindArray(unsigned proto);
97  const bindings_t *getCuttingBindArray(unsigned proto);
98 }
99 
100 #endif /* MYTHDTO_H */
const bindings_t * getRecordingBindArray(unsigned proto)
Returns bindings for Myth::Recording.
Definition: mythdto.cpp:49
const bindings_t * getProgramBindArray(unsigned proto)
Returns bindings for Myth::Program.
Definition: mythdto.cpp:65
const bindings_t * getListBindArray(unsigned proto)
Returns bindings for Myth::List.
Definition: mythdto.cpp:36
const bindings_t * getCuttingBindArray(unsigned proto)
Returns bindings for Myth::Mark.
Definition: mythdto.cpp:95
This namespace contains all DTO definitions.
Definition: artwork.h:27
const bindings_t * getArtworkBindArray(unsigned proto)
Returns bindings for Myth::Artwork.
Definition: mythdto.cpp:58
Brings together all attribute bindings of an object.
Definition: mythdto.h:66
const bindings_t * getChannelBindArray(unsigned proto)
Returns bindings for Myth::Channel.
Definition: mythdto.cpp:42
attr_bind_t * attr_bind
Definition: mythdto.h:69
const bindings_t * getCaptureCardBindArray(unsigned proto)
Returns bindings for Myth::CaptureCard.
Definition: mythdto.cpp:72
const bindings_t * getVideoSourceBindArray(unsigned proto)
Returns bindings for Myth::VideoSource.
Definition: mythdto.cpp:79
int attr_count
Definition: mythdto.h:68
const char * field
Definition: mythdto.h:57
FT_t type
Definition: mythdto.h:58
const bindings_t * getVersionBindArray(unsigned ranking)
Returns bindings for Myth::Version.
Definition: mythdto.cpp:30
Definition of binding from a source field to an object attribute.
Definition: mythdto.h:55
const bindings_t * getRecordScheduleBindArray(unsigned proto)
Returns bindings for Myth::RecordSchedule.
Definition: mythdto.cpp:86