ACE_MMAP_Memory_Pool_Options Class Reference

Helper class for MMAP Memory Pool constructor options. More...

#include <MMAP_Memory_Pool.h>

List of all members.

Public Types

 FIRSTCALL_FIXED = 0
 ALWAYS_FIXED = 1
 NEVER_FIXED = 2
enum  { FIRSTCALL_FIXED = 0, ALWAYS_FIXED = 1, NEVER_FIXED = 2 }

Public Member Functions

 ACE_MMAP_Memory_Pool_Options (const void *base_addr=ACE_DEFAULT_BASE_ADDR, int use_fixed_addr=ALWAYS_FIXED, bool write_each_page=true, size_t minimum_bytes=0, u_int flags=0, bool guess_on_fault=true, LPSECURITY_ATTRIBUTES sa=0, mode_t file_mode=ACE_DEFAULT_FILE_PERMS, bool unique_=false, bool install_signal_handler=true)
 Constructor.

Public Attributes

const void * base_addr_
 Base address of the memory-mapped backing store.
int use_fixed_addr_
bool write_each_page_
size_t minimum_bytes_
 What the minimim bytes of the initial segment should be.
u_int flags_
 Any special flags that need to be used for mmap.
bool guess_on_fault_
LPSECURITY_ATTRIBUTES sa_
 Pointer to a security attributes object. Only used on NT.
mode_t file_mode_
 File mode for mmaped file, if it is created.
bool unique_
 Do we want an unique backing store name?
bool install_signal_handler_
 Should we install a signal handler.

Private Member Functions

 ACE_MMAP_Memory_Pool_Options (const ACE_MMAP_Memory_Pool_Options &)
ACE_MMAP_Memory_Pool_Optionsoperator= (const ACE_MMAP_Memory_Pool_Options &)


Detailed Description

Helper class for MMAP Memory Pool constructor options.

This should be a nested class, but that breaks too many compilers.

Definition at line 40 of file MMAP_Memory_Pool.h.


Member Enumeration Documentation

anonymous enum

Enumerator:
FIRSTCALL_FIXED  The base address from the first call to mmap will be used for subsequent calls to mmap.
ALWAYS_FIXED  The base address specified in base_addr will be used in all calls to mmap.
NEVER_FIXED  The base address will be selected by the OS for each call to mmap. Caution should be used with this mode since a call that requires the backing store to grow may change pointers that are cached by the application.

Definition at line 43 of file MMAP_Memory_Pool.h.

00044   {
00045     /**
00046      * The base address from the first call to mmap will be used for subsequent
00047      * calls to mmap.
00048      */
00049     FIRSTCALL_FIXED = 0,
00050 
00051     /**
00052      * The base address specified in base_addr will be used in all calls to
00053      * mmap.
00054      */
00055     ALWAYS_FIXED = 1,
00056 
00057     /**
00058      * The base address will be selected by the OS for each call to mmap.
00059      * Caution should be used with this mode since a call that requires the
00060      * backing store to grow may change pointers that are cached by the
00061      * application.
00062      */
00063     NEVER_FIXED = 2
00064   };


Constructor & Destructor Documentation

ACE_MMAP_Memory_Pool_Options::ACE_MMAP_Memory_Pool_Options ( const void *  base_addr = ACE_DEFAULT_BASE_ADDR,
int  use_fixed_addr = ALWAYS_FIXED,
bool  write_each_page = true,
size_t  minimum_bytes = 0,
u_int  flags = 0,
bool  guess_on_fault = true,
LPSECURITY_ATTRIBUTES  sa = 0,
mode_t  file_mode = ACE_DEFAULT_FILE_PERMS,
bool  unique_ = false,
bool  install_signal_handler = true 
)

Constructor.

Definition at line 456 of file MMAP_Memory_Pool.cpp.

References ACE_TRACE, ALWAYS_FIXED, base_addr_, FIRSTCALL_FIXED, and use_fixed_addr_.

00467   : base_addr_ (base_addr),
00468     use_fixed_addr_ (use_fixed_addr),
00469     write_each_page_ (write_each_page),
00470     minimum_bytes_ (minimum_bytes),
00471     flags_ (flags),
00472     guess_on_fault_ (guess_on_fault),
00473     sa_ (sa),
00474     file_mode_ (file_mode),
00475     unique_ (unique),
00476     install_signal_handler_ (install_signal_handler)
00477 {
00478   ACE_TRACE ("ACE_MMAP_Memory_Pool_Options::ACE_MMAP_Memory_Pool_Options");
00479   // for backwards compatability
00480   if (base_addr_ == 0 && use_fixed_addr_ == ALWAYS_FIXED)
00481     use_fixed_addr_ = FIRSTCALL_FIXED;
00482 }

ACE_MMAP_Memory_Pool_Options::ACE_MMAP_Memory_Pool_Options ( const ACE_MMAP_Memory_Pool_Options  )  [private]


Member Function Documentation

ACE_MMAP_Memory_Pool_Options& ACE_MMAP_Memory_Pool_Options::operator= ( const ACE_MMAP_Memory_Pool_Options  )  [private]


Member Data Documentation

const void* ACE_MMAP_Memory_Pool_Options::base_addr_

Base address of the memory-mapped backing store.

Definition at line 79 of file MMAP_Memory_Pool.h.

Referenced by ACE_MMAP_Memory_Pool::ACE_MMAP_Memory_Pool(), and ACE_MMAP_Memory_Pool_Options().

mode_t ACE_MMAP_Memory_Pool_Options::file_mode_

File mode for mmaped file, if it is created.

Definition at line 116 of file MMAP_Memory_Pool.h.

Referenced by ACE_MMAP_Memory_Pool::ACE_MMAP_Memory_Pool().

u_int ACE_MMAP_Memory_Pool_Options::flags_

Any special flags that need to be used for mmap.

Definition at line 103 of file MMAP_Memory_Pool.h.

Referenced by ACE_MMAP_Memory_Pool::ACE_MMAP_Memory_Pool().

bool ACE_MMAP_Memory_Pool_Options::guess_on_fault_

Try to remap without knowing the faulting address. This parameter is ignored on platforms that know the faulting address (UNIX with SI_ADDR and Win32).

Definition at line 110 of file MMAP_Memory_Pool.h.

Referenced by ACE_MMAP_Memory_Pool::ACE_MMAP_Memory_Pool().

bool ACE_MMAP_Memory_Pool_Options::install_signal_handler_

Should we install a signal handler.

Definition at line 122 of file MMAP_Memory_Pool.h.

Referenced by ACE_MMAP_Memory_Pool::ACE_MMAP_Memory_Pool().

size_t ACE_MMAP_Memory_Pool_Options::minimum_bytes_

What the minimim bytes of the initial segment should be.

Definition at line 100 of file MMAP_Memory_Pool.h.

Referenced by ACE_MMAP_Memory_Pool::ACE_MMAP_Memory_Pool().

LPSECURITY_ATTRIBUTES ACE_MMAP_Memory_Pool_Options::sa_

Pointer to a security attributes object. Only used on NT.

Definition at line 113 of file MMAP_Memory_Pool.h.

Referenced by ACE_MMAP_Memory_Pool::ACE_MMAP_Memory_Pool().

bool ACE_MMAP_Memory_Pool_Options::unique_

Do we want an unique backing store name?

Definition at line 119 of file MMAP_Memory_Pool.h.

Referenced by ACE_MMAP_Memory_Pool::ACE_MMAP_Memory_Pool().

int ACE_MMAP_Memory_Pool_Options::use_fixed_addr_

Determines whether we set base_addr_ or if mmap(2) selects it FIRSTCALL_FIXED The base address from the first call to mmap will be used for subsequent calls to mmap ALWAYS_FIXED The base address specified in base_addr will be used in all calls to mmap. NEVER_FIXED The base address will be selected by the OS for each call to mmap. Caution should be used with this mode since a call that requires the backing store to grow may change pointers that are cached by the application.

Definition at line 93 of file MMAP_Memory_Pool.h.

Referenced by ACE_MMAP_Memory_Pool::ACE_MMAP_Memory_Pool(), and ACE_MMAP_Memory_Pool_Options().

bool ACE_MMAP_Memory_Pool_Options::write_each_page_

Should each page be written eagerly to avoid surprises later on?

Definition at line 97 of file MMAP_Memory_Pool.h.

Referenced by ACE_MMAP_Memory_Pool::ACE_MMAP_Memory_Pool().


The documentation for this class was generated from the following files:
Generated on Tue Feb 2 17:35:21 2010 for ACE by  doxygen 1.4.7