The VisAO Camera
sharedim_stack< IMDATA_TYPE > Class Template Reference

Class to manage a stack of images in shared memory. More...

#include <sharedim_stack.h>

Public Member Functions

 sharedim_stack ()
 Constructor.
 
void * get_shmemptr ()
 
key_t get_shmemkey ()
 
int get_shmemid ()
 
size_t get_shmemsz ()
 
int get_n_images ()
 Returns the value of n_images currently in the header.
 
int set_max_n_images (int mni)
 Sets max_n_images in the header.
 
int get_max_n_images ()
 Returns the value of max_n_images currently in the header.
 
int get_last_image ()
 Returns the value of last_image currently in the header.
 
int get_last_image_abs ()
 
sharedim< IMDATA_TYPE > * calc_im_pos (int imno)
 Calculates the offset of the image given by imno, takes into account max_n_images and available space.
 
int set_saved (int imno, int sv)
 Update the saved field of this image.
 
int create_shm (key_t mkey, size_t sz)
 For the writer process, creates then attaches the shared memory.
 
int create_shm (key_t mkey, int nims, size_t imsz)
 For the writer process, creates then attaches the shared memory.
 
int attach_shm (key_t mkey)
 Attachess the shared memory. A Reader process should start here.
 
sharedim< IMDATA_TYPE > * set_next_image (int nx, int ny)
 Sets the next image, and returns a pointer to it, but does not increment last_image.
 
int enable_next_image ()
 Increments last_image.
 
sharedim< IMDATA_TYPE > get_image (int imno)
 Gets an image, as a sharedim structure, with the imdata pointer properly set for the calling process.
 

Public Attributes

sharedim_stack_headerheader
 Convenient pointer to the stack header, has same value as shmemptr.
 
int next_last_image
 

Protected Attributes

void * shmemptr
 The pointer to the shared memory block.
 
key_t shmemkey
 The key used to lookup the shared memory.
 
int shmemid
 The shared memory id.
 
size_t shmemsz
 Size of the shared memory block.
 
intptr_t * image_list
 Convenient pointer to the list of image offsets.
 
struct shmid_ds shmstats
 Used to retrieve shared memory block size.
 

Detailed Description

template<class IMDATA_TYPE>
class sharedim_stack< IMDATA_TYPE >

Can be used by both the writer and the readers

Definition at line 101 of file sharedim_stack.h.


The documentation for this class was generated from the following files: