Aria  2.7.5.2
ArMap.h File Reference

Contains the definition of the ArMap class, the primary class for Aria maps. More...

#include "ariaTypedefs.h"
#include "ariaUtil.h"
#include "ArMapComponents.h"
#include "ArMapInterface.h"
#include "ArMapUtils.h"
#include "ArFunctor.h"
#include "ArArgumentBuilder.h"
#include "ArMutex.h"
#include <vector>

Classes

class  ArMap
 A map of a space the robot can navigate within, and which can be updated via the Aria config. More...
 

Detailed Description

Contains the definition of the ArMap class, the primary class for Aria maps.

Aria maps are implemented by a collection of classes and interfaces. The most important is the ArMapInterface, which is defined in ArMapInterface.h and specifies the methods that all Aria maps must provide.

This file contains the top-level concrete implementation of the ArMapInterface. ArMap is basically the map that is used by the robot to navigate its environment. In addition to implementing the methods of ArMapInterface, ArMap also provides a means of hooking into the Aria config. When the map file name is specified in the Aria config and is changed during runtime, ArMap loads the new file and notifies all listeners that the map has been changed.

In order to accomplish this, ArMap has been implemented using the Proxy design pattern (refer to "Design Patterns", Gamma et al, 1995). The participants are as follows:

  • Subject: ArMapInterface. The common interface for both the RealSubject and the Proxy. It is defined in ArMapInterface.h and is actually the combination of several smaller interfaces: ArMapScanInterface, ArMapObjectsInterface, ArMapInfoInterface, and ArMapSupplementInterface.
  • RealSubject: ArMapSimple. The real object that the Proxy represents. It is defined in ArMapComponents.h, and is implemented by a set of helper classes that are also defined in that header file.
  • Proxy: ArMap. Creates and controls access to the RealSubject. ArMap actually contains references to two ArMapSimple objects. One is permanent and is the map object that is used by the robot. The other is transient and is the map object that is currently being read from a file following an Aria configuration update. If the file is successfully read, then the loading ArMapSimple object is copied to the main permanent one and mapChanged notifications are sent to registered listeners.

The following "diagram" illustrates the basic hierarchy:

  
       ArMapInterface                          , Defined in ArMapInterface.h
       ^ (extends)  ^ 
       |            |
       |            |
    ArMap +-------> ArMapSimple * +-------> ArMapScan *
                (contains)        |
                                  +-------> ArMapObjects *
                                  |
                                  +-------> ArMapInfo *
                                  |
                                  +-------> ArMapSupplement *

This header file originally also contained the definition of ArMapObject.  
That class has been moved into its own header file (ArMapObject.h).
Maintenance Note #1: In this case, the use of the Proxy design pattern implies 
that modifying the ArMap external interface requires multiple changes:  
First, the ArMapInterface (or sub-interface) must be updated.  Then the ArMap 
and ArMapSimple classes must be modified.  Depending on the change, one of the
helper map components may also need to be modified.  It is expected that 
such changes to the interface will be infrequent.
See Also
ArMapInfo
ArMapObject
ArMapObjects
ArMapScan
ArMapSupplement