]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - ipc/ipcdev.git/blob - qnx/include/ti/ipc/interfaces/IMessageQTransport.h
Add IPC cluster support to socket utility functions
[ipc/ipcdev.git] / qnx / include / ti / ipc / interfaces / IMessageQTransport.h
1 /*
2  * Copyright (c) 2014-2015 Texas Instruments Incorporated - http://www.ti.com
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * *  Redistributions of source code must retain the above copyright
10  *    notice, this list of conditions and the following disclaimer.
11  *
12  * *  Redistributions in binary form must reproduce the above copyright
13  *    notice, this list of conditions and the following disclaimer in the
14  *    documentation and/or other materials provided with the distribution.
15  *
16  * *  Neither the name of Texas Instruments Incorporated nor the names of
17  *    its contributors may be used to endorse or promote products derived
18  *    from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
33 /*
34  *  ======== IMessageQTransport.h ========
35  */
37 #ifndef IMESSAGEQTRANSPORT_H
38 #define IMESSAGEQTRANSPORT_H
40 #include <ti/ipc/interfaces/ITransport.h>
42 /* opaque instance handle */
43 typedef struct IMessageQTransport_Object *IMessageQTransport_Handle;
45 #define IMessageQTransport_TypeId 0x02
47 /* virtual functions */
48 typedef struct IMessageQTransport_Fxns {
49     Int (*bind)(void *handle, UInt32 queueId);
50     Int (*unbind)(void *handle, UInt32 queueId);
51     Bool (*put)(void *handle, Ptr msg);
52 } IMessageQTransport_Fxns;
54 /* abstract instance object */
55 typedef struct IMessageQTransport_Object {
56     ITransport_Object base;             /* inheritance */
57     IMessageQTransport_Fxns *fxns;      /* virtual functions */
58 } IMessageQTransport_Object;
60 /* function stubs */
61 static inline
62 Int IMessageQTransport_bind(IMessageQTransport_Handle inst, UInt32 queueId)
63 {
64     IMessageQTransport_Object *obj = (IMessageQTransport_Object *)inst;
65     return obj->fxns->bind((void *)inst, queueId);
66 }
68 static inline
69 Int IMessageQTransport_unbind(IMessageQTransport_Handle inst, UInt32 queueId)
70 {
71     IMessageQTransport_Object *obj = (IMessageQTransport_Object *)inst;
72     return obj->fxns->unbind((void *)inst, queueId);
73 }
75 static inline
76 Bool IMessageQTransport_put(IMessageQTransport_Handle inst, Ptr msg)
77 {
78     IMessageQTransport_Object *obj = (IMessageQTransport_Object *)inst;
79     return obj->fxns->put((void *)inst, msg);
80 }
82 /* instance convertors */
83 static inline
84 ITransport_Handle IMessageQTransport_upCast(IMessageQTransport_Handle inst)
85 {
86     IMessageQTransport_Object *obj = (IMessageQTransport_Object *)inst;
87     return (ITransport_Handle)&obj->base;
88 }
90 static inline
91 IMessageQTransport_Handle IMessageQTransport_downCast(ITransport_Handle base)
92 {
93     return (IMessageQTransport_Handle)base;
94 }
96 #endif /* IMESSAGEQTRANSPORT_H */