GoWebScan API
 All Classes Files Functions Variables Typedefs Macros Modules Pages
GoWebScanPipeMsg.h
Go to the documentation of this file.
1 /**
2 * @file GoWebScanPipeMsg.h
3 * @brief Declares the GoWebScanPipeMsg class
4 *
5 * @internal
6 * Copyright (C) 2017-2018 by LMI Technologies Inc.
7 * Licensed under the MIT License.
8 * Redistributed files must retain the above copyright notice.
9 */
10 #ifndef GO_SCANNER_PIPE_MSG_H
11 #define GO_SCANNER_PIPE_MSG_H
12 
14 
15 kBeginHeader()
16 
17 /**
18 * @class GoWebScanPipeMsg
19 * @extends kObject
20 * @ingroup GoWebScanSdk-Pipe
21 * @brief Base class for a msg that can be processed with a GoWebScanPipeTask and submitted to the GoWebScanPipe for scheduling.
22 * GoWebScanPipeMsg objects have a thread-safe reference count. GoWebScanPipeMsg objects are always allocated from
23 * GoWebScanPipeMsgPool objects with a default reference count of 1. When the reference count reaches zero, the message is
24 * recycled to the pool free list. This allows for efficient reuse of message memory.
25 */
26 typedef kObject GoWebScanPipeMsg;
27 
28 // Forward declarations
30 
31 /**
32 * Increments the msg's reference count.
33 *
34 * @public @memberof GoWebScanPipeMsg
35 * @param msg GoWebScanPipeMsg object.
36 * @return Operation status.
37 */
38 GoWebScanFx(kStatus) GoWebScanPipeMsg_Acquire(GoWebScanPipeMsg msg);
39 
40 /**
41 * Decrements the msg's reference count. If the count reaches zero, the message is recycled to the
42 * GoWebScanPipeMsgPool free list.
43 *
44 * @public @memberof GoWebScanPipeMsg
45 * @param msg GoWebScanPipeMsg object.
46 * @return Operation status.
47 */
48 GoWebScanFx(kStatus) GoWebScanPipeMsg_Relinquish(GoWebScanPipeMsg msg);
49 
50 /**
51 * Sets the stamp associated with the message.
52 *
53 * @public @memberof GoWebScanPipeMsg
54 * @param msg GoWebScanPipeMsg object.
55 * @param stamp Message stamp.
56 * @return Operation status.
57 */
58 GoWebScanFx(kStatus) GoWebScanPipeMsg_SetStamp(GoWebScanPipeMsg msg, const GoWebScanMsgStamp* stamp);
59 
60 /**
61 * Gets the stamp associated with the message.
62 *
63 * @public @memberof GoWebScanPipeMsg
64 * @param msg GoWebScanPipeMsg object.
65 * @return Message stamp.
66 */
67 GoWebScanFx(GoWebScanMsgStamp*) GoWebScanPipeMsg_GetStamp(GoWebScanPipeMsg msg);
68 
69 /**
70 * Gets the message type.
71 *
72 * @public @memberof GoWebScanPipeMsg
73 * @param msg GoWebScanPipeMsg object.
74 * @return Message type.
75 */
76 GoWebScanFx(GoWebScanMsgType) GoWebScanPipeMsg_TypeId(GoWebScanPipeMsg msg);
77 
78 /**
79 * Gets the size, in bytes, of the message's data buffer.
80 *
81 * @public @memberof GoWebScanPipeMsg
82 * @param msg GoWebScanPipeMsg object.
83 * @return Message size.
84 */
85 GoWebScanFx(kSize) GoWebScanPipeMsg_Size(GoWebScanPipeMsg msg);
86 
87 kEndHeader()
88 #include <GoWebScanSdk/GoWebScanPipeMsg.x.h>
89 
90 #endif
91 
kStatus GoWebScanPipeMsg_Relinquish(GoWebScanPipeMsg msg)
Decrements the msg's reference count.
GoWebScanMsgStamp * GoWebScanPipeMsg_GetStamp(GoWebScanPipeMsg msg)
Gets the stamp associated with the message.
kStatus GoWebScanPipeMsg_SetStamp(GoWebScanPipeMsg msg, const GoWebScanMsgStamp *stamp)
Sets the stamp associated with the message.
Essential GoWebScan declarations.
kSize GoWebScanPipeMsg_Size(GoWebScanPipeMsg msg)
Gets the size, in bytes, of the message's data buffer.
Represents a message stamp containing properties of a message.
Definition: GoWebScanSdkDef.h:479
Represents a type of GoWebScan message.
Represents a pool of GoWebScanPipeMsg objects. The pool allocates GoWebScanPipeMsg objects with a def...
Base class for a msg that can be processed with a GoWebScanPipeTask and submitted to the GoWebScanPip...
GoWebScanMsgType GoWebScanPipeMsg_TypeId(GoWebScanPipeMsg msg)
Gets the message type.
kStatus GoWebScanPipeMsg_Acquire(GoWebScanPipeMsg msg)
Increments the msg's reference count.