Shared Persistent Heap Data Environment Manual  1.1.0
sphlogportal.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011-2014 IBM Corporation.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation, Steven Munroe - initial API and implementation
10  */
11 
12 #ifndef __SPH_LOG_PORTAL_H
13 #define __SPH_LOG_PORTAL_H
14 
38 #include "sastype.h"
39 #include "sphlflogger.h"
40 
45 typedef void *SPHLogPortal_t;
46 
47 #ifdef __cplusplus
48 #define __C__ "C"
49 #else
50 #define __C__
51 #endif
52 
62 typedef struct {
74 
87 extern __C__ SPHLogPortal_t
88 SPHLogPortalInit (void* buf_seg, block_size_t buf_size);
89 
99 extern __C__ SPHLogPortal_t
100 SPHLogPortalCreate (block_size_t buf_size);
101 
108 extern __C__ int
110 
116 extern __C__ int
118 
124 extern __C__ int
126 
139 extern __C__ SPHLFLogger_t
141 
150 extern __C__ SPHLFLogger_t
152 
162 extern __C__ SPHLFLogger_t
164 
172 extern __C__ int
174 
191  int catcode, int subcode,
192  SPHLFLoggerHandle_t *handlespace);
193 
212  int catcode, int subcode,
213  block_size_t alloc_size,
214  SPHLFLoggerHandle_t *handlespace);
215 
234  SPHLFPortalIterator_t *iteratorSpace);
235 
258  SPHLFLoggerHandle_t *handlespace);
259 
272 extern __C__ void *
274  block_size_t alloc_size);
275 
283 extern __C__ int
285 
286 #endif /* __SPH_LOG_PORTAL_H */
__C__ SPHLFLoggerHandle_t * SPHLFPortalIteratorNext(SPHLFPortalIterator_t *iterator, SPHLFLoggerHandle_t *handlespace)
Access a sequence of completed logger entries in-order.
longPtr_t capacity
Definition: sphlogportal.h:72
__C__ SPHLogPortal_t SPHLogPortalCreate(block_size_t buf_size)
Allocate and initialize a shared storage block as a Log Portal.
Instance of a Lock Free Logger Iterator.
Definition: sphlflogger.h:264
__C__ SPHLFLogger_t SPHLogPortalGetLoggerByIndex(SPHLogPortal_t portal, longPtr_t index)
Return the handle of the Logger in the Portal list slot specified by the index number.
__C__ SPHLFLoggerHandle_t * SPHLogPortalAllocStrideTimeStamped(SPHLogPortal_t portal, int catcode, int subcode, SPHLFLoggerHandle_t *handlespace)
Return the handle of a Logger entry allocated from the current logger of the Portal. If the current logger is full, attempt to move current to the next available Logger and retry.
__C__ SPHLogPortal_t SPHLogPortalInit(void *buf_seg, block_size_t buf_size)
Initialize a shared storage block as a Log Portal.
void * SPHLogPortal_t
Handle to an instance of SPH Log Portal.
Definition: sphlogportal.h:45
SPHLFLogIterator_t logIter
Definition: sphlogportal.h:64
Shared Persistent Heap, logger. For shared memory multi-thread/multi-core applications. This implementation uses atomic operations to implement Lock Free Loggers (SPHLFLogger_t).
#define __C__
ignore this macro behind the curtain
Definition: sasmsync.h:32
longPtr_t current
Definition: sphlogportal.h:68
__C__ int SPHLogPortalEntries(SPHLogPortal_t portal)
Return the number of active Loggers in the portal list.
__C__ SPHLFLoggerHandle_t * SPHLogPortalAllocTimeStamped(SPHLogPortal_t portal, int catcode, int subcode, block_size_t alloc_size, SPHLFLoggerHandle_t *handlespace)
Return the handle of a Logger entry allocated from the current logger of the Portal. If the current logger is full, attempt to move current to the next available Logger and retry.
Instance of a Lock Free Logger Entry Handle.
Definition: sphlflogger.h:244
SPHLogPortal_t portal
Definition: sphlogportal.h:66
void * SPHLFLogger_t
Handle to an instance of SPH Lock Free Logger.
Definition: sphlflogger.h:173
unsigned long longPtr_t
unsigned int type, consistent with the size of a pointer and used for pointer calculations ...
Definition: sphlflogger.h:183
longPtr_t next_free
Definition: sphlogportal.h:70
__C__ int SPHLogPortalEmpty(SPHLogPortal_t portal)
Return the status of the specified Log Portal.
__C__ int SPHLogPortalGetCurrentIndex(SPHLogPortal_t portal)
Return the index of the current Logger target of the Portal.
__C__ int SPHLogPortalCapacity(SPHLogPortal_t portal)
Return the maximum number of Loggers the list can hold.
__C__ SPHLFPortalIterator_t * SPHLFPortalCreateIterator(SPHLogPortal_t portal, SPHLFPortalIterator_t *iteratorSpace)
Create an iterator positioned at the first entry of the first logger attached to this portal...
__C__ SPHLFLogger_t SPHLogPortalGetCurrentLogger(SPHLogPortal_t portal)
Return the handle of the current Logger target of the Portal.
__C__ void * SPHLogPortalAllocRaw(SPHLogPortal_t portal, block_size_t alloc_size)
Return the address of a (raw) Logger entry allocated from the current logger.
__C__ int SPHLogPortalDestroy(SPHLogPortal_t portal)
Destroy the Log Portal and free the storage.
Instance of a Log Portal Iterator.
Definition: sphlogportal.h:62
__C__ SPHLFLogger_t SPHLogPortalAddLogger(SPHLogPortal_t portal, SPHLFLogger_t log)
Insert a SPHLFLogger_t into the next free slot og this Log Portal. This Logger can be then be used to...