LocalMacroSpaceManager Class Reference

#include <LocalMacroSpaceManager.hpp>

Inheritance diagram for LocalMacroSpaceManager:
[legend]

Public Member Functions

 LocalMacroSpaceManager ()
 
RexxReturnCode loadMacroSpace (const char *target)
 
RexxReturnCode loadMacroSpace (const char *target, const char **nameList, size_t nameCount)
 
RexxReturnCode saveMacroSpace (const char *target)
 
RexxReturnCode queryMacro (const char *target, size_t *pos)
 
RexxReturnCode reorderMacro (const char *target, size_t pos)
 
RexxReturnCode getMacro (const char *target, RXSTRING &image)
 
RexxReturnCode saveMacroSpace (const char *target, const char **names, size_t count)
 
RexxReturnCode clearMacroSpace ()
 
RexxReturnCode removeMacro (const char *name)
 
RexxReturnCode addMacroFromFile (const char *name, const char *sourceFile, size_t position)
 
RexxReturnCode addMacro (const char *name, ManagedRxstring &imageData, size_t position)
 
void translateRexxProgram (const char *sourcefile, ManagedRxstring &imageData)
 
void readRxstringFromFile (SysFile *file, ManagedRxstring &target, size_t size)
 
RexxReturnCode mapReturnResult (ServiceMessage &m)
 
virtual RexxReturnCode processServiceException (ServiceException *e)
 
- Public Member Functions inherited from LocalAPISubsystem
virtual ~LocalAPISubsystem ()
 
virtual void initializeLocal (LocalAPIManager *a)
 
virtual void terminateProcess ()
 

Additional Inherited Members

- Protected Attributes inherited from LocalAPISubsystem
LocalAPIManagerapiManager
 

Detailed Description

Definition at line 166 of file LocalMacroSpaceManager.hpp.

Constructor & Destructor Documentation

◆ LocalMacroSpaceManager()

LocalMacroSpaceManager::LocalMacroSpaceManager ( )

Definition at line 275 of file LocalMacroSpaceManager.cpp.

Member Function Documentation

◆ addMacro()

RexxReturnCode LocalMacroSpaceManager::addMacro ( const char *  name,
ManagedRxstring imageData,
size_t  position 
)

Add a macro from image data into the macrospace.

Parameters
nameThe name of the macro.
imageDataThe source image data
positionThe search order position.

Definition at line 569 of file LocalMacroSpaceManager.cpp.

References ADD_MACRO, MacroSpaceManager, mapReturnResult(), ServiceMessage::parameter1, ServiceMessage::parameter2, ClientMessage::send(), ServiceMessage::setMessageData(), Rxstring::strlength, and Rxstring::strptr.

Referenced by addMacroFromFile().

◆ addMacroFromFile()

RexxReturnCode LocalMacroSpaceManager::addMacroFromFile ( const char *  name,
const char *  sourceFile,
size_t  position 
)

Load a macro from a file and store into the macrospace.

Parameters
nameThe name of the macro.
sourceFileThe target source file.
positionThe macro search position.

Definition at line 552 of file LocalMacroSpaceManager.cpp.

References addMacro(), and translateRexxProgram().

◆ clearMacroSpace()

RexxReturnCode LocalMacroSpaceManager::clearMacroSpace ( )

Clear all macros from the macro space.

Definition at line 493 of file LocalMacroSpaceManager.cpp.

References CLEAR_MACRO_SPACE, MacroSpaceManager, mapReturnResult(), and ClientMessage::send().

◆ getMacro()

RexxReturnCode LocalMacroSpaceManager::getMacro ( const char *  target,
RXSTRING image 
)

Retrieve a macro from the daemon server.

Parameters
targetThe target macro name.
imageThe returned image data.

Definition at line 423 of file LocalMacroSpaceManager.cpp.

References GET_MACRO_IMAGE, MacroSpaceManager, mapReturnResult(), RXMACRO_OK, ClientMessage::send(), and ServiceMessage::transferMessageData().

◆ loadMacroSpace() [1/2]

◆ loadMacroSpace() [2/2]

RexxReturnCode LocalMacroSpaceManager::loadMacroSpace ( const char *  target,
const char **  nameList,
size_t  nameCount 
)

Load a macrospace file, using just the subset of names in the file.

Parameters
targetThe target macrospace file.
nameListThe list of names to load.
nameCountThe number of items to load.

Definition at line 326 of file LocalMacroSpaceManager.cpp.

References ADD_MACRO, MacroSpaceFile::close(), MacroSpaceDescriptor::MACRONAMESIZE, MacroSpaceManager, MacroSpaceFile::nextMacro(), MacroSpaceFile::openForLoading(), ServiceMessage::parameter1, ServiceMessage::parameter2, RXMACRO_OK, ClientMessage::send(), ServiceMessage::setMessageData(), Rxstring::strlength, and Rxstring::strptr.

◆ mapReturnResult()

RexxReturnCode LocalMacroSpaceManager::mapReturnResult ( ServiceMessage m)

Process an result returned from the server and map it into an API return code.

Parameters
mThe return message.
Returns
The mapped return code.

Definition at line 711 of file LocalMacroSpaceManager.cpp.

References MACRO_DOES_NOT_EXIST, ServiceMessage::result, RXMACRO_NOT_FOUND, and RXMACRO_OK.

Referenced by addMacro(), clearMacroSpace(), getMacro(), queryMacro(), removeMacro(), reorderMacro(), and saveMacroSpace().

◆ processServiceException()

RexxReturnCode LocalMacroSpaceManager::processServiceException ( ServiceException e)
virtual

◆ queryMacro()

RexxReturnCode LocalMacroSpaceManager::queryMacro ( const char *  name,
size_t *  pos 
)

Check the macro space for a give item, returning the order information.

Parameters
nameThe name to check.
pos

Definition at line 521 of file LocalMacroSpaceManager.cpp.

References MacroSpaceManager, mapReturnResult(), ServiceMessage::parameter1, QUERY_MACRO, and ClientMessage::send().

◆ readRxstringFromFile()

void LocalMacroSpaceManager::readRxstringFromFile ( SysFile fileInst,
ManagedRxstring target,
size_t  size 
)

Read a buffer of data from a file and return in a ManagedRxString.

Parameters
fileInstThe source file.
targetThe rxstring used to return the file data.
sizeThe size to read.

Definition at line 648 of file LocalMacroSpaceManager.cpp.

References ManagedRxstring::ensureCapacity(), MACROSPACE_FILE_READ_ERROR, SysFile::read(), Rxstring::strlength, and Rxstring::strptr.

Referenced by translateRexxProgram().

◆ removeMacro()

RexxReturnCode LocalMacroSpaceManager::removeMacro ( const char *  name)

Remove a macro from the macrospace.

Parameters
nameThe name of the macro to remove.

Definition at line 506 of file LocalMacroSpaceManager.cpp.

References MacroSpaceManager, mapReturnResult(), REMOVE_MACRO, and ClientMessage::send().

◆ reorderMacro()

RexxReturnCode LocalMacroSpaceManager::reorderMacro ( const char *  name,
size_t  pos 
)

Change the search order for a macro item.

Parameters
nameThe name of the target macro.
posThe new search order.

Definition at line 536 of file LocalMacroSpaceManager.cpp.

References MacroSpaceManager, mapReturnResult(), ServiceMessage::parameter1, REORDER_MACRO, and ClientMessage::send().

◆ saveMacroSpace() [1/2]

◆ saveMacroSpace() [2/2]

RexxReturnCode LocalMacroSpaceManager::saveMacroSpace ( const char *  target,
const char **  names,
size_t  count 
)

◆ translateRexxProgram()

void LocalMacroSpaceManager::translateRexxProgram ( const char *  sourceFile,
ManagedRxstring imageData 
)

Translate a source file into a Rexx program.

Parameters
sourceFileThe source file name.
imageDataThe returned image data.

Definition at line 589 of file LocalMacroSpaceManager.cpp.

References SysFile::close(), SysLibrary::getProcedure(), SysFile::getSize(), SysLibrary::load(), MACRO_SOURCE_NOT_FOUND, MACRO_SOURCE_READ_ERROR, MACRO_TRANSLATION_ERROR, SysFile::open(), readRxstringFromFile(), RexxEntry, RX_O_RDONLY, RX_SH_DENYWR, Rxstring::strlength, and Rxstring::strptr.

Referenced by addMacroFromFile().


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