Loading...
Searching...
No Matches
sphlogportal.h
Go to the documentation of this file.
/*
* Copyright (c) 2011-2014 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation, Steven Munroe - initial API and implementation
*/
#ifndef __SPH_LOG_PORTAL_H
#define __SPH_LOG_PORTAL_H
#include "sastype.h"
#include "sphlflogger.h"
typedef void *SPHLogPortal_t;
#ifdef __cplusplus
#define __C__ "C"
#else
#define __C__
#endif
typedef struct {
SPHLFLogIterator_t logIter;
SPHLogPortal_t portal;
longPtr_t current;
longPtr_t next_free;
longPtr_t capacity;
} SPHLFPortalIterator_t;
extern __C__ SPHLogPortal_t
SPHLogPortalInit (void* buf_seg, block_size_t buf_size);
extern __C__ SPHLogPortal_t
SPHLogPortalCreate (block_size_t buf_size);
extern __C__ int
SPHLogPortalEmpty (SPHLogPortal_t portal);
extern __C__ int
SPHLogPortalEntries (SPHLogPortal_t portal);
extern __C__ int
SPHLogPortalCapacity (SPHLogPortal_t portal);
extern __C__ SPHLFLogger_t
SPHLogPortalAddLogger (SPHLogPortal_t portal, SPHLFLogger_t log);
extern __C__ SPHLFLogger_t
SPHLogPortalGetCurrentLogger (SPHLogPortal_t portal);
extern __C__ SPHLFLogger_t
SPHLogPortalGetLoggerByIndex (SPHLogPortal_t portal, longPtr_t index);
extern __C__ int
SPHLogPortalGetCurrentIndex (SPHLogPortal_t portal);
extern __C__ SPHLFLoggerHandle_t*
SPHLogPortalAllocStrideTimeStamped (SPHLogPortal_t portal,
int catcode, int subcode,
SPHLFLoggerHandle_t *handlespace);
extern __C__ SPHLFLoggerHandle_t*
SPHLogPortalAllocTimeStamped (SPHLogPortal_t portal,
int catcode, int subcode,
block_size_t alloc_size,
SPHLFLoggerHandle_t *handlespace);
extern __C__ SPHLFPortalIterator_t*
SPHLFPortalCreateIterator (SPHLogPortal_t portal,
SPHLFPortalIterator_t *iteratorSpace);
extern __C__ SPHLFLoggerHandle_t*
SPHLFPortalIteratorNext (SPHLFPortalIterator_t *iterator,
SPHLFLoggerHandle_t *handlespace);
extern __C__ void *
SPHLogPortalAllocRaw (SPHLogPortal_t portal,
block_size_t alloc_size);
extern __C__ int
SPHLogPortalDestroy(SPHLogPortal_t portal);
#endif /* __SPH_LOG_PORTAL_H */
__C__
#define __C__
ignore this macro behind the curtain
Definition sasmsync.h:32
sphlflogger.h
Shared Persistent Heap, logger. For shared memory multi-thread/multi-core applications....
SPHLFLogger_t
void * SPHLFLogger_t
Handle to an instance of SPH Lock Free Logger.
Definition sphlflogger.h:173
longPtr_t
unsigned long longPtr_t
unsigned int type, consistent with the size of a pointer and used for pointer calculations
Definition sphlflogger.h:183
SPHLogPortalAllocStrideTimeStamped
__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....
SPHLogPortalEntries
__C__ int SPHLogPortalEntries(SPHLogPortal_t portal)
Return the number of active Loggers in the portal list.
SPHLogPortalInit
__C__ SPHLogPortal_t SPHLogPortalInit(void *buf_seg, block_size_t buf_size)
Initialize a shared storage block as a Log Portal.
SPHLogPortalCreate
__C__ SPHLogPortal_t SPHLogPortalCreate(block_size_t buf_size)
Allocate and initialize a shared storage block as a Log Portal.
SPHLFPortalCreateIterator
__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.
SPHLogPortal_t
void * SPHLogPortal_t
Handle to an instance of SPH Log Portal.
Definition sphlogportal.h:45
SPHLogPortalAllocTimeStamped
__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....
SPHLogPortalAllocRaw
__C__ void * SPHLogPortalAllocRaw(SPHLogPortal_t portal, block_size_t alloc_size)
Return the address of a (raw) Logger entry allocated from the current logger.
SPHLogPortalGetCurrentLogger
__C__ SPHLFLogger_t SPHLogPortalGetCurrentLogger(SPHLogPortal_t portal)
Return the handle of the current Logger target of the Portal.
SPHLogPortalDestroy
__C__ int SPHLogPortalDestroy(SPHLogPortal_t portal)
Destroy the Log Portal and free the storage.
SPHLogPortalGetLoggerByIndex
__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.
SPHLogPortalAddLogger
__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...
SPHLogPortalCapacity
__C__ int SPHLogPortalCapacity(SPHLogPortal_t portal)
Return the maximum number of Loggers the list can hold.
SPHLogPortalGetCurrentIndex
__C__ int SPHLogPortalGetCurrentIndex(SPHLogPortal_t portal)
Return the index of the current Logger target of the Portal.
SPHLogPortalEmpty
__C__ int SPHLogPortalEmpty(SPHLogPortal_t portal)
Return the status of the specified Log Portal.
SPHLFPortalIteratorNext
__C__ SPHLFLoggerHandle_t * SPHLFPortalIteratorNext(SPHLFPortalIterator_t *iterator, SPHLFLoggerHandle_t *handlespace)
Access a sequence of completed logger entries in-order.
SPHLFLogIterator_t
Instance of a Lock Free Logger Iterator.
Definition sphlflogger.h:264
SPHLFLoggerHandle_t
Instance of a Lock Free Logger Entry Handle.
Definition sphlflogger.h:244
SPHLFPortalIterator_t
Instance of a Log Portal Iterator.
Definition sphlogportal.h:62
SPHLFPortalIterator_t::logIter
SPHLFLogIterator_t logIter
Definition sphlogportal.h:64
SPHLFPortalIterator_t::current
longPtr_t current
Definition sphlogportal.h:68
SPHLFPortalIterator_t::capacity
longPtr_t capacity
Definition sphlogportal.h:72
SPHLFPortalIterator_t::next_free
longPtr_t next_free
Definition sphlogportal.h:70
SPHLFPortalIterator_t::portal
SPHLogPortal_t portal
Definition sphlogportal.h:66