Line data Source code
1 : /* File: data_full_id.inl; Copyright and License: see below */
2 :
3 : #include <assert.h>
4 :
5 2 : static inline void data_full_id_init_void ( data_full_id_t *this_ )
6 : {
7 2 : data_id_init_void( &((*this_).primary_id) );
8 2 : data_id_init_void( &((*this_).secondary_id) );
9 2 : }
10 :
11 1 : static inline void data_full_id_reinit_void ( data_full_id_t *this_ )
12 : {
13 1 : data_id_reinit_void( &((*this_).primary_id) );
14 1 : data_id_reinit_void( &((*this_).secondary_id) );
15 1 : }
16 :
17 1 : static inline void data_full_id_init ( data_full_id_t *this_, const data_id_t *primary_id, const data_id_t *secondary_id )
18 : {
19 1 : assert ( ( DATA_TABLE_VOID == data_id_get_table( secondary_id ) )
20 : || ( DATA_TABLE_CLASSIFIER == data_id_get_table( secondary_id ) )
21 : );
22 :
23 1 : (*this_).primary_id = *primary_id;
24 1 : (*this_).secondary_id = *secondary_id;
25 1 : }
26 :
27 1 : static inline void data_full_id_reinit ( data_full_id_t *this_, const data_id_t *primary_id, const data_id_t *secondary_id )
28 : {
29 1 : assert ( ( DATA_TABLE_VOID == data_id_get_table( secondary_id ) )
30 : || ( DATA_TABLE_CLASSIFIER == data_id_get_table( secondary_id ) )
31 : );
32 :
33 1 : (*this_).primary_id = *primary_id;
34 1 : (*this_).secondary_id = *secondary_id;
35 1 : }
36 :
37 1 : static inline void data_full_id_init_solo ( data_full_id_t *this_, const data_id_t *primary_id )
38 : {
39 1 : (*this_).primary_id = *primary_id;
40 1 : data_id_init_void( &((*this_).secondary_id) );
41 1 : }
42 :
43 1 : static inline void data_full_id_reinit_solo ( data_full_id_t *this_, const data_id_t *primary_id )
44 : {
45 1 : (*this_).primary_id = *primary_id;
46 1 : data_id_reinit_void( &((*this_).secondary_id) );
47 1 : }
48 :
49 1 : static inline void data_full_id_init_by_table_and_id ( data_full_id_t *this_,
50 : data_table_t primary_table,
51 : data_row_t primary_row_id,
52 : data_table_t secondary_table,
53 : data_row_t secondary_row_id )
54 : {
55 1 : assert ( ( DATA_TABLE_VOID == secondary_table )
56 : || ( DATA_TABLE_CLASSIFIER == secondary_table )
57 : );
58 :
59 1 : data_id_init ( &((*this_).primary_id), primary_table, primary_row_id );
60 1 : data_id_init ( &((*this_).secondary_id), secondary_table, secondary_row_id );
61 1 : }
62 :
63 1 : static inline void data_full_id_reinit_by_table_and_id ( data_full_id_t *this_,
64 : data_table_t primary_table,
65 : data_row_t primary_row_id,
66 : data_table_t secondary_table,
67 : data_row_t secondary_row_id )
68 : {
69 1 : assert ( ( DATA_TABLE_VOID == secondary_table )
70 : || ( DATA_TABLE_CLASSIFIER == secondary_table )
71 : );
72 :
73 1 : data_id_reinit ( &((*this_).primary_id), primary_table, primary_row_id );
74 1 : data_id_reinit ( &((*this_).secondary_id), secondary_table, secondary_row_id );
75 1 : }
76 :
77 1 : static inline void data_full_id_copy ( data_full_id_t *this_, const data_full_id_t *that )
78 : {
79 1 : data_id_copy ( &((*this_).primary_id), &((*that).primary_id) );
80 1 : data_id_copy ( &((*this_).secondary_id), &((*that).secondary_id) );
81 1 : }
82 :
83 1 : static inline void data_full_id_replace ( data_full_id_t *this_, const data_full_id_t *that )
84 : {
85 1 : data_id_replace ( &((*this_).primary_id), &((*that).primary_id) );
86 1 : data_id_replace ( &((*this_).secondary_id), &((*that).secondary_id) );
87 1 : }
88 :
89 5 : static inline void data_full_id_destroy ( data_full_id_t *this_ )
90 : {
91 5 : data_id_destroy( &((*this_).primary_id) );
92 5 : data_id_destroy( &((*this_).secondary_id) );
93 5 : }
94 :
95 19 : static inline data_id_t data_full_id_get_primary_id ( const data_full_id_t *this_ )
96 : {
97 19 : return (*this_).primary_id;
98 : }
99 :
100 4 : static inline const data_id_t *data_full_id_get_primary_id_const ( const data_full_id_t *this_ )
101 : {
102 4 : return &((*this_).primary_id);
103 : }
104 :
105 19 : static inline data_id_t data_full_id_get_secondary_id ( const data_full_id_t *this_ )
106 : {
107 19 : return (*this_).secondary_id;
108 : }
109 :
110 2 : static inline const data_id_t *data_full_id_get_secondary_id_const ( const data_full_id_t *this_ )
111 : {
112 2 : return &((*this_).secondary_id);
113 : }
114 :
115 2 : static inline bool data_full_id_equals ( const data_full_id_t *this_, const data_full_id_t *that )
116 : {
117 2 : return data_id_equals( &((*this_).primary_id), &((*that).primary_id) );
118 : }
119 :
120 3 : static inline bool data_full_id_is_valid ( const data_full_id_t *this_ )
121 : {
122 3 : return data_id_is_valid( &((*this_).primary_id) );
123 : }
124 :
125 2 : static inline void data_full_id_trace ( const data_full_id_t *this_ )
126 : {
127 2 : data_id_trace( &((*this_).primary_id) );
128 2 : data_id_trace( &((*this_).secondary_id) );
129 2 : }
130 :
131 :
132 : /*
133 : Copyright 2017-2025 Andreas Warnke
134 :
135 : Licensed under the Apache License, Version 2.0 (the "License");
136 : you may not use this file except in compliance with the License.
137 : You may obtain a copy of the License at
138 :
139 : http://www.apache.org/licenses/LICENSE-2.0
140 :
141 : Unless required by applicable law or agreed to in writing, software
142 : distributed under the License is distributed on an "AS IS" BASIS,
143 : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
144 : See the License for the specific language governing permissions and
145 : limitations under the License.
146 : */
|