Types.h
Go to the documentation of this file.
00001 /*********************************************************************
00002  * Software License Agreement (BSD License)
00003  *
00004  *  Copyright (c) 2013, Institute for Artificial Intelligence,
00005  *  Universität Bremen.
00006  *  All rights reserved.
00007  *
00008  *  Redistribution and use in source and binary forms, with or without
00009  *  modification, are permitted provided that the following conditions
00010  *  are met:
00011  *
00012  *   * Redistributions of source code must retain the above copyright
00013  *     notice, this list of conditions and the following disclaimer.
00014  *   * Redistributions in binary form must reproduce the above
00015  *     copyright notice, this list of conditions and the following
00016  *     disclaimer in the documentation and/or other materials provided
00017  *     with the distribution.
00018  *   * Neither the name of the Institute for Artificial Intelligence,
00019  *     Universität Bremen, nor the names of its contributors may be
00020  *     used to endorse or promote products derived from this software
00021  *     without specific prior written permission.
00022  *
00023  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00024  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00025  *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00026  *  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
00027  *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00028  *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00029  *  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00030  *  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00031  *  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00032  *  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
00033  *  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00034  *  POSSIBILITY OF SUCH DAMAGE.
00035  *********************************************************************/
00036 
00040 #ifndef __TYPES_H__
00041 #define __TYPES_H__
00042 
00043 
00044 // System
00045 #include <string>
00046 #include <list>
00047 #include <designators/CDesignator.h>
00048 #include <vector>
00049 #include <map>
00050 
00051 // Private
00052 #include <Node.h>
00053 
00054 
00055 namespace beliefstate {
00056   class PluginInstance;
00057   
00059   typedef enum {
00061     SI_REQUEST,
00063     SI_RESPONSE
00064   } ServiceIdentifier;
00065   
00067   typedef enum {
00069     SM_FIRST_RESULT,
00071     SM_AGGREGATE_RESULTS,
00073     SM_IGNORE_RESULTS
00074   } ServiceModifier;
00075   
00080   typedef enum {
00084     RI_NONE,
00086     RI_PLUGIN_LOADING_FAILED,
00088     RI_CONFIG_FILE_NOT_FOUND,
00090     RI_FILE_NOT_FOUND,
00092     RI_PLUGIN_DEPENDENCY_NOT_MET,
00101     RI_PLUGIN_DEVELOPMENT_NOT_LOADING
00102   } ResultIdentifier;
00103   
00105   typedef struct {
00107     std::string strColorCode;
00109     bool bBold;
00114     std::string strPrefix;
00116     std::string strMessage;
00117   } StatusMessage;
00118   
00120   typedef struct {
00128     std::string strEventName;
00129     int nContextID;
00134     CDesignator* cdDesignator;
00135     std::string strSupplementary;
00137     std::string strAnnotation;
00139     int nOriginID;
00140     int nOpenRequestID;
00141     bool bRequest;
00142     bool bPreempt;
00143     StatusMessage msgStatusMessage;
00145     std::list<Node*> lstNodes;
00146     std::list<Node*> lstRootNodes;
00147     std::list< std::pair<std::string, std::string> > lstDesignatorIDs;
00148     std::list< std::pair<std::string, std::string> > lstEquations;
00149     std::list< std::pair<std::string, std::string> > lstEquationTimes;
00150     int nSequenceNumber;
00151   } Event;
00152   
00154   typedef struct {
00155     ServiceIdentifier siServiceIdentifier;
00156     ServiceModifier smResultModifier;
00157     std::string strServiceName;
00158     int nServiceEventID;
00159     bool bPreserve;
00160     int nRequesterID;
00161     CDesignator* cdDesignator;
00162     std::list<Event> lstResultEvents;
00163     int nSequenceNumber;
00164   } ServiceEvent;
00165   
00170   typedef struct {
00171     // Generic fields
00172     bool bSuccess;
00173     ResultIdentifier riResultIdentifier;
00174     std::list<Event> lstEvents;
00175     std::list<ServiceEvent> lstServiceEvents;
00176     
00177     // In case of failure
00178     std::string strErrorMessage;
00179     
00180     // Status message that were collected
00181     std::list<StatusMessage> lstStatusMessages;
00182     
00183     PluginInstance* piPlugin;
00184   } Result;
00185   
00189   typedef struct {
00190     // Basics
00191     std::string strBaseDataDirectory;
00192     std::string strExperimentNameMask;
00193     
00194     // Current Experiment Instance
00195     std::string strExperimentDirectory;
00196     std::string strSymlinkName;
00197     
00198     // MongoDB
00199     bool bUseMongoDB;
00200     std::string strMongoDBHost;
00201     int nMongoDBPort;
00202     std::string strMongoDBDatabase;
00203     
00204     // Plugin loading
00205     bool bLoadDevelopmentPlugins;
00206     bool bFailedPluginsInvalidateStartup;
00207     
00208     // Plugin output
00209     std::vector<std::string> vecPluginOutputColors;
00210     
00211     // Miscellaneous
00212     bool bDisplayUnhandledEvents;
00213     bool bDisplayUnhandledServiceEvents;
00214     bool bOnlyDisplayImportant;
00215   } ConfigSettings;
00216 }
00217 
00218 
00219 #endif /* __TYPES_H__ */


beliefstate
Author(s): Jan Winkler
autogenerated on Sun Oct 5 2014 22:30:15