GoWebScan API
GoWebScanPipeMsgPool.h
Go to the documentation of this file.
1 /**
2 * @file GoWebScanPipeMsgPool.h
3 * @brief Declares the GoWebScanPipeMsgPool class.
4 *
5 * @internal
6 * Copyright (C) 2017-2026 by LMI Technologies Inc.
7 * Licensed under the MIT License.
8 * Redistributed files must retain the above copyright notice.
9 */
10 #ifndef GO_WEB_SCAN_PIPE_MSG_POOL_H
11 #define GO_WEB_SCAN_PIPE_MSG_POOL_H
12 
14 
15 /**
16 * @class GoWebScanPipeMsgPool
17 * @extends kObject
18 * @ingroup GoWebScanSdk-Pipe
19 * @brief Represents a pool of GoWebScanPipeMsg objects. The pool allocates GoWebScanPipeMsg objects
20 * with a default reference count of 1. Messages are recycled to the pool's free list when the
21 * message's reference count reaches 0. A GoWebScanPipeMsgPool can only contain GoWebScanPipeMsg
22 * objects of the same GoWebScanMsgType
23 */
25 
26 // Forward declaration
28 
29 /** Defines the signature for the memory allocation handler for a message. */
31 
32 /** Defines the signature for the memory recycling handler for a message. */
34 
35 /** Defines the signature for the message destruction handler. */
37 
38 /** Defines the signature for the message size handler. */
40 
41 /**
42 * Constructs a GoWebScanPipeMsgPool object.
43 *
44 * @public @memberof GoWebScanPipeMsgPool
45 * @param pool Receives the constructed GoWebScanPipeMsgPool object.
46 * @param allocator Memory allocator (or kNULL for default).
47 * @return Operation status.
48 */
50 
51 /**
52 * Sets the message allocation callback function
53 *
54 * @public @memberof GoWebScanPipeMsgPool
55 * @param pool GoWebScanPipeMsgPool object.
56 * @param alloc Message allocation callback function
57 * @param receiver Receiver argument for callback.
58 * @return Operation status.
59 */
61 
62 /**
63 * Sets the callback function for the message's data buffer size (in bytes).
64 *
65 * @public @memberof GoWebScanPipeMsgPool
66 * @param pool GoWebScanPipeMsgPool object.
67 * @param size Message size callback function
68 * @return Operation status.
69 */
71 
72 /**
73 * Sets the callback function to recycle memory allocated for a message
74 *
75 * @public @memberof GoWebScanPipeMsgPool
76 * @param pool GoWebScanPipeMsgPool object.
77 * @param free Free message callback function
78 * @return Operation status.
79 */
81 
82 /**
83 * Sets the message destruction callback function
84 *
85 * @public @memberof GoWebScanPipeMsgPool
86 * @param pool GoWebScanPipeMsgPool object.
87 * @param destroy Message destruction callback function
88 * @return Operation status.
89 */
91 
92 /**
93 * Allocates a GoWebScanPipeMsg object and adds it to the pool's allocated list. Memory is recycled from the
94 * pool's free list if available.
95 *
96 * @public @memberof GoWebScanPipeMsgPool
97 * @param pool GoWebScanPipeMsgPool object.
98 * @param msg Receives the allocated GoWebScanPipeMsg object.
99 * @return Operation status.
100 */
102 
103 /**
104 * Gets the count of the pool's allocated list.
105 *
106 * @public @memberof GoWebScanPipeMsgPool
107 * @param pool GoWebScanPipeMsgPool object.
108 * @return Count of pool's allocated list
109 */
111 
112 /**
113 * Gets the count of the pool's free list.
114 *
115 * @public @memberof GoWebScanPipeMsgPool
116 * @param pool GoWebScanPipeMsgPool object.
117 * @return Count of pool's free list
118 */
120 
121 #include <GoWebScanSdk/GoWebScanPipeMsgPool.x.h>
122 
123 #endif
124 
kStatus(kCall * GoWebScanPipeMsgPoolDestroyFx)(GoWebScanPipeMsg msg)
Defines the signature for the message destruction handler.
Definition: GoWebScanPipeMsgPool.h:36
kStatus GoWebScanPipeMsgPool_Construct(GoWebScanPipeMsgPool *pool, kAlloc allocator)
Constructs a GoWebScanPipeMsgPool object.
kStatus GoWebScanPipeMsgPool_SetSizeHandler(GoWebScanPipeMsgPool pool, GoWebScanPipeMsgPoolSizeFx size)
Sets the callback function for the message's data buffer size (in bytes).
kSize GoWebScanPipeMsgPool_AllocCount(GoWebScanPipeMsgPool pool)
Gets the count of the pool's allocated list.
Essential GoWebScan declarations.
kStatus(kCall * GoWebScanPipeMsgPoolAllocFx)(kPointer context, GoWebScanPipeMsgPool pool, GoWebScanPipeMsg *msg)
Defines the signature for the memory allocation handler for a message.
Definition: GoWebScanPipeMsgPool.h:30
kStatus GoWebScanPipeMsgPool_SetAllocHandler(GoWebScanPipeMsgPool pool, GoWebScanPipeMsgPoolAllocFx alloc, kPointer receiver)
Sets the message allocation callback function.
kStatus(kCall * GoWebScanPipeMsgPoolFreeFx)(GoWebScanPipeMsg msg)
Defines the signature for the memory recycling handler for a message.
Definition: GoWebScanPipeMsgPool.h:33
kStatus GoWebScanPipeMsgPool_SetFreeHandler(GoWebScanPipeMsgPool pool, GoWebScanPipeMsgPoolFreeFx free)
Sets the callback function to recycle memory allocated for a message.
kSize(kCall * GoWebScanPipeMsgPoolSizeFx)(GoWebScanPipeMsg msg)
Defines the signature for the message size handler.
Definition: GoWebScanPipeMsgPool.h:39
kSize GoWebScanPipeMsgPool_FreeCount(GoWebScanPipeMsgPool pool)
Gets the count of the pool's free list.
kStatus GoWebScanPipeMsgPool_Alloc(GoWebScanPipeMsgPool pool, GoWebScanPipeMsg *msg)
Allocates a GoWebScanPipeMsg object and adds it to the pool's allocated list.
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...
kStatus GoWebScanPipeMsgPool_SetDestroyHandler(GoWebScanPipeMsgPool pool, GoWebScanPipeMsgPoolDestroyFx destroy)
Sets the message destruction callback function.