summaryrefslogtreecommitdiff
path: root/include_protected/persistence_client_library_rc_table.h
blob: 7ea58d392ee09d9ccf7f1203d2c6aa2d0f1cfba1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#ifndef PERSISTENCE_CLIENT_LIBRARY_RC_TABLE_H
#define PERSISTENCE_CLIENT_LIBRARY_RC_TABLE_H

/******************************************************************************
 * Project         Persistency
 * (c) copyright   2012
 * Company         XS Embedded GmbH
 *****************************************************************************/
/******************************************************************************
 * This Source Code Form is subject to the terms of the
 * Mozilla Public License, v. 2.0. If a  copy of the MPL was not distributed
 * with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
******************************************************************************/
 /**
 * @file           persistence_client_library_rc_table.h
 * @ingroup        Persistence client library
 * @author         Ingo Huerner
 * @brief          Header of the persistence client library resource config table.
 * @see            
 */

#ifdef __cplusplus
extern "C" {
#endif

#define  PERSIST_DATA_RC_TABLE_INTERFACE_VERSION   (0x01000000U)

#include "persistence_client_library_data_organization.h"


/// enumerator used to identify the policy to manage the data
typedef enum _PersistencePolicy_e
{
   PersistencePolicy_wc    = 0,  /**< the data is managed write cached */
   PersistencePolicy_wt    = 1,  /**< the data is managed write through */
   PersistencePolicy_na    = 2,  /**< the data is not applicable */

   /** insert new entries here ... */
   PersistencePolicy_LastEntry         /**< last entry */

} PersistencePolicy_e;


/// enumerator used to identify the persistence storage to manage the data
typedef enum _PersistenceStorage_e
{
   PersistenceStorage_local    = 0,  /**< the data is managed local */
   PersistenceStorage_shared   = 1,  /**< the data is managed shared */
   PersistenceStorage_custom   = 2,  /**< the data is managed over custom client implementation */

   /** insert new entries here ... */
   PersistenceStoragePolicy_LastEntry         /**< last entry */

} PersistenceStorage_e;


/// structure used to manage database context
typedef struct _PersistenceDbContext_s
{
   unsigned int ldbid;
   unsigned int user_no;
   unsigned int seat_no;
} PersistenceDbContext_s;


/// structure used to manage the persistence configuration for a key
typedef struct _PersistenceConfigurationKey_s
{
   PersistencePolicy_e  policy;                                /**< policy  */
   PersistenceStorage_e storage;                               /**< definition of storage to use */
   unsigned int         permission;                            /**< access right, corresponds to UNIX */
   unsigned int         max_size;                              /**< max size expected for the key */
   char                 reponsible[MaxConfKeyLengthResp];      /**< name of responsible application */
   char                 custom_name[MaxConfKeyLengthCusName];  /**< name of the customer plugin */
} PersistenceConfigurationKey_s;


/// structure definition of an persistence resource configuration table entry
typedef struct _PersistenceRctEntry_s
{
    char key[PrctKeySize];                                   /**< the key */
    PersistenceConfigurationKey_s data;                      /**< data for the key */
}
PersistenceRctEntry_s;


/// persistence information
typedef struct _PersistenceInfo_s
{
   PersistenceDbContext_s           context;          /**< database context*/
   PersistenceConfigurationKey_s    configKey;        /**< prct configuration key*/

} PersistenceInfo_s;



/// persistence resource config table type definition
typedef enum _PersistenceRCT_e
{
   PersistenceRCT_local         = 0,
   PersistenceRCT_shared_public = 1,
   PersistenceRCT_shared_group  = 2,

   PersistenceRCT_LastEntry                // last Entry

} PersistenceRCT_e;



#ifdef __cplusplus
}
#endif

#endif /* PERSISTENCY_CLIENT_LIBRARY_RC_TABLE_H */