Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

ACE_Svc_Conf_Lexer_Guard Class Reference

"Guard" that ensures lexer buffer switching is exception-safe. More...

#include <Svc_Conf_Lexer_Guard.h>

List of all members.

Public Methods

 ACE_Svc_Conf_Lexer_Guard (ACE_Svc_Conf_Param *param)
 Constructor. More...

 ~ACE_Svc_Conf_Lexer_Guard (void)
 Destructor. More...


Private Attributes

ace_yy_buffer_state * buffer_
 Lexer buffer that corresponds to the current Service Configurator file/direct scan. More...


Detailed Description

"Guard" that ensures lexer buffer switching is exception-safe.

Buffers are switched, if necessary, each time a token is parsed/scanned. The buffer switching must be synchronized externally. This class performs no synchronization.

Note:
Note that allocation/deallocation is done once during the processing of a service configurator directive. Memory managements is done at a higher level, not in this class. This is necessary to prevent an allocation/deallocation from occurring when parsing/scanning each token.

Definition at line 45 of file Svc_Conf_Lexer_Guard.h.


Constructor & Destructor Documentation

ACE_Svc_Conf_Lexer_Guard::ACE_Svc_Conf_Lexer_Guard ACE_Svc_Conf_Param   param
 

Constructor.

Switches buffers, if necessary, when token scanning first begins. Allocation of the buffer will also occur if one has not already been allocated. This operation effectively pushes a buffer on to a stack.

Definition at line 14 of file Svc_Conf_Lexer_Guard.cpp.

References ace_yy_push_buffer, buffer_, and ACE_Svc_Conf_Param::SVC_CONF_FILE.

00015   : buffer_ (0)
00016 {
00017   // External synchronization is required.
00018 
00019   // Note that allocation/deallocation is done once during the
00020   // processing of a service configurator directive.  Memory
00021   // managements is done at a higher level, not in this class.  This
00022   // is necessary to prevent an allocation/deallocation from occurring
00023   // when parsing/scanning each token.
00024 
00025   if (param->type == ACE_Svc_Conf_Param::SVC_CONF_FILE)
00026     ::ace_yy_push_buffer (param->source.file, param->buffer);
00027   
00028 else    ::ace_yy_push_buffer (param->source.directive,
00029                           param->buffer);
00030 
00031   this->buffer_ = param->buffer;
00032 }

ACE_Svc_Conf_Lexer_Guard::~ACE_Svc_Conf_Lexer_Guard void   
 

Destructor.

Switches buffers, if necessary when token scanning completes. No buffer deallocation occurs here. Buffers are deallocated when parsing of the entire directive is done, not when scanning of a single token is done. This operation effective pops a buffer off of a stack.

Definition at line 34 of file Svc_Conf_Lexer_Guard.cpp.

References buffer_.

00035 {
00036   // External synchronization is required.
00037 
00038   ::ace_yy_pop_buffer (this->buffer_);
00039 }


Member Data Documentation

ace_yy_buffer_state* ACE_Svc_Conf_Lexer_Guard::buffer_ [private]
 

Lexer buffer that corresponds to the current Service Configurator file/direct scan.

Definition at line 72 of file Svc_Conf_Lexer_Guard.h.

Referenced by ACE_Svc_Conf_Lexer_Guard, and ~ACE_Svc_Conf_Lexer_Guard.


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 12:57:08 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002