source: rtems/cpukit/rtems/include/rtems/rtems/object.h @ c86cc72

4.115
Last change on this file since c86cc72 was c86cc72, checked in by Ralf Corsepius <ralf.corsepius@…>, on 06/18/10 at 05:28:04

2010-06-18 Ralf Corsépius <ralf.corsepius@…>

  • rtems/include/rtems/rtems/object.h: Remove OBJECTS_ITRON_API.
  • Property mode set to 100644
File size: 9.4 KB
Line 
1/**
2 * @file rtems/rtems/object.h
3 */
4
5/*  COPYRIGHT (c) 1989-2008.
6 *  On-Line Applications Research Corporation (OAR).
7 *
8 *  The license and distribution terms for this file may be
9 *  found in the file LICENSE in this distribution or at
10 *  http://www.rtems.com/license/LICENSE.
11 *
12 *  $Id$
13 */
14
15#ifndef _RTEMS_RTEMS_OBJECT_H
16#define _RTEMS_RTEMS_OBJECT_H
17
18#include <stdint.h>
19#include <rtems/score/object.h>
20#include <rtems/rtems/status.h>
21#include <rtems/rtems/types.h>
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27/**
28 *  @defgroup ClassicClassInfo Object Class Information
29 *
30 *  @ingroup ClassicRTEMS
31 *
32 *  This encapsulates functionality which XXX
33 */
34/**@{*/
35
36/**
37 *  This structure is used to return information to the application
38 *  about the objects configured for a specific API/Class combination.
39 */
40typedef struct {
41  /** This field is the minimum valid object Id for this class. */
42  rtems_id  minimum_id;
43  /** This field is the maximum valid object Id for this class. */
44  rtems_id  maximum_id;
45  /** This field is the number of object instances configured for this class. */
46  uint32_t  maximum;
47  /** This field indicates if the class is configured for auto-extend. */
48  bool      auto_extend;
49  /** This field is the number of currently unallocated objects. */
50  uint32_t  unallocated;
51} rtems_object_api_class_information;
52
53/**
54 *  @brief Build Object Id
55 *
56 *  This function returns an object id composed of the
57 *  specified @a api, @a class, @a node,
58 *  and @a index.
59 *
60 *  @param[in] _api indicates the api to use for the Id
61 *  @param[in] _class indicates the class to use for the Id
62 *  @param[in] _node indicates the node to use for the Id
63 *  @param[in] _index indicates the index to use for the Id
64 *
65 *  @return This method returns an object Id built from the
66 *          specified values.
67 *
68 *  @note A body is also provided.
69 */
70#define rtems_build_id( _api, _class, _node, _index ) \
71  _Objects_Build_id( _api, _class, _node, _index )
72
73/**
74 *  @brief Build Thirty-Two Bit Object Name
75 *
76 *  This function returns an object name composed of the four characters
77 *  C1, C2, C3, and C4.
78 *
79 *  @param[in] _C1 is the first character of the name
80 *  @param[in] _C2 is the second character of the name
81 *  @param[in] _C3 is the third character of the name
82 *  @param[in] _C4 is the fourth character of the name
83 *
84 *  @note This must be implemented as a macro for use in
85 *        Configuration Tables.  A body is also provided.
86 *
87 */
88#define rtems_build_name( _C1, _C2, _C3, _C4 ) \
89  _Objects_Build_name( _C1, _C2, _C3, _C4 )
90
91/** @brief Obtain name of object
92 *
93 *  This directive returns the name associated with the specified
94 *  object ID.
95 *
96 *  @param[in] id is the Id of the object to obtain the name of.
97 *  @param[out] name will be set to the name of the object
98 *
99 *  @note The object must be have a name of the 32-bit form.
100 *
101 *  @return @a *name will contain user defined object name
102 *  @return @a RTEMS_SUCCESSFUL - if successful
103 *  @return error code - if unsuccessful
104 */
105rtems_status_code rtems_object_get_classic_name(
106  rtems_id      id,
107  rtems_name   *name
108);
109
110/**
111 *  @brief Obtain Object Name as String
112 *
113 *  This directive returns the name associated with the specified
114 *  object ID.
115 *
116 *  @param[in] id is the Id of the object to obtain the name of
117 *  @param[in] length is the length of the output name buffer
118 *  @param[out] name will be set to the name of the object
119 *
120 *  @return @a *name will contain user defined object name
121 *  @return @a name - if successful
122 *  @return @a NULL - if unsuccessful
123 */
124char *rtems_object_get_name(
125  rtems_id       id,
126  size_t         length,
127  char          *name
128);
129
130/**
131 *  @brief Set Name of Object
132 *
133 *  This method allows the caller to set the name of an
134 *  object.  This can be used to set the name of objects
135 *  which do not have a naming scheme per their API.
136 *
137 *  @param[in] id is the Id of the object to obtain the name of
138 *  @param[out] name will be set to the name of the object
139 *
140 *  @return @a *name will contain user defined object name
141 *  @return @a RTEMS_SUCCESSFUL - if successful
142 *  @return error code - if unsuccessful
143 */
144rtems_status_code rtems_object_set_name(
145  rtems_id       id,
146  const char    *name
147);
148
149/**
150 *  @brief Get API Portion of Object Id
151 *
152 *  This function returns the API portion of the Id.
153 *
154 *  @param[in] _id is the Id of the object to obtain the API from
155 *
156 *  @return This method returns the API portion of the provided
157 *          @a _id.
158 *
159 *  @note This method does NOT validate the @a _id provided.
160 *
161 *  @note A body is also provided.
162 */
163#define rtems_object_id_get_api( _id ) \
164  _Objects_Get_API( _id )
165
166/**
167 *  @brief Get Class Portion of Object Id
168 *
169 *  This function returns the class portion of the ID.
170 *
171 *  @param[in] _id is the Id of the object to obtain the class from
172 *
173 *  @return This method returns the class portion of the provided
174 *          @a _id.
175 *
176 *  @note This method does NOT validate the @a _id provided.
177 *
178 *  @note A body is also provided.
179 */
180#define rtems_object_id_get_class( _id ) \
181  _Objects_Get_class( _id )
182
183/**
184 *  @brief Get Node Portion of Object Id
185 *
186 *  This function returns the node portion of the ID.
187 *
188 *  @param[in] _id is the Id of the object to obtain the node from
189 *
190 *  @return This method returns the node portion of the provided
191 *          @a _id.
192 *
193 *  @note This method does NOT validate the @a _id provided.
194 *
195 *  @note A body is also provided.
196 */
197#define rtems_object_id_get_node( _id ) \
198  _Objects_Get_node( _id )
199
200/**
201 *  @brief Get Index Portion of Object Id
202 *
203 *  This function returns the index portion of the ID.
204 *
205 *  @param[in] _id is the Id of the object to obtain the index from
206 *
207 *  @return This method returns the index portion of the provided
208 *          @a _id.
209 *
210 *  @note This method does NOT validate the @a _id provided.
211 *
212 *  @note A body is also provided.
213 */
214#define rtems_object_id_get_index( _id ) \
215  _Objects_Get_index( _id )
216
217/**
218 *  @brief Get Lowest Valid API Index
219 *
220 *  This method returns the lowest valid value for the API
221 *  portion of an RTEMS object Id.
222 *
223 *  @return This method returns the least valid value for
224 *          the API portion of an RTEMS object Id.
225 *
226 *  @note A body is also provided.
227 */
228#define rtems_object_id_api_minimum() \
229  OBJECTS_INTERNAL_API
230
231/**
232 *  @brief Get Highest Valid API Index
233 *
234 *  This method returns the highest valid value for the API
235 *  portion of an RTEMS object Id.
236 *
237 *  @return This method returns the greatest valid value for
238 *          the API portion of an RTEMS object Id.
239 *
240 *  @note A body is also provided.
241 */
242#define rtems_object_id_api_maximum() \
243  OBJECTS_APIS_LAST
244
245/**
246 *  @brief Get Lowest Valid Class Value
247 *
248 *  This method returns the lowest valid value Class for the
249 *  specified @a api.  Each API supports a different number
250 *  of object classes.
251 *
252 *  @param[in] api is the API to obtain the minimum class of
253 *
254 *  @return This method returns the least valid value for
255 *          class number for the specified @a api.
256 */
257int rtems_object_api_minimum_class(
258  int api
259);
260
261/**
262 *  @brief Get Highest Valid Class Value
263 *
264 *  This method returns the highest valid value Class for the
265 *  specified @a api.  Each API supports a different number
266 *  of object classes.
267 *
268 *  @param[in] api is the API to obtain the maximum class of
269 *
270 *  @return This method returns the greatet valid value for
271 *          class number for the specified @a api.
272 */
273int rtems_object_api_maximum_class(
274  int api
275);
276
277
278/**
279 *  @brief Get Highest Valid Class Value
280 *
281 *  This method returns the lowest valid value Class for the
282 *  specified @a api.  Each API supports a different number
283 *  of object classes.
284 *
285 *  @param[in] api is the API to obtain the maximum class of
286 *
287 *  @return This method returns the least valid value for
288 *          class number for the specified @a api.
289 */
290int rtems_object_id_api_maximum_class(
291  int api
292);
293
294/**
295 *  @brief Get API Name
296 *
297 *  This method returns a string containing the name of the
298 *  specified @a api.
299 *
300 *  @param[in] api is the API to obtain the name of
301 *
302 *  @return If successful, this method returns the name of
303 *          the specified @a api.  Otherwise, it returns
304 *          the string "BAD API"
305 */
306const char *rtems_object_get_api_name(
307  int api
308);
309
310/**
311 *  @brief Get Class Name
312 *
313 *  This method returns a string containing the name of the
314 *  @a class from the specified @a api.
315 *
316 *  @param[in] the_api is the API for the class
317 *  @param[in] the_class is the class to obtain the name of
318 *
319 *  @return If successful, this method returns the name of
320 *          the specified @a class.  Otherwise, it returns
321 *          the string "BAD CLASS"
322 */
323const char *rtems_object_get_api_class_name(
324  int the_api,
325  int the_class
326);
327
328/**
329 *  @brief Get Class Name
330 *
331 *  This method returns a string containing the name of the
332 *  @a the_class from the specified @a api.
333 *
334 *  @param[in] the_api is the API for the class
335 *  @param[in] the_class is the class to obtain information about
336 *  @param[in] info points to the information structure to fill in
337 *
338 *  @return If successful, this method returns the name of
339 *          RTEMS_SUCCESSFUL with @a *info filled in. Otherwise,
340 *          a status is returned to indicate the error.
341 *
342 */
343rtems_status_code rtems_object_get_class_information(
344  int                                 the_api,
345  int                                 the_class,
346  rtems_object_api_class_information *info
347);
348
349#ifdef __cplusplus
350}
351#endif
352
353/**@}*/
354
355#endif
356/* end of include file */
Note: See TracBrowser for help on using the repository browser.