Matrix Science header

ms_security_task.hpp

00001 /*
00002 ##############################################################################
00003 # file: ms_security_task.hpp                                                 #
00004 # 'msparser' toolkit                                                         #
00005 # Encapsulates Mascot security as used in authentication                     #
00006 ##############################################################################
00007 # COPYRIGHT NOTICE                                                           #
00008 # Copyright 1998-2004 Matrix Science Limited  All Rights Reserved.           #
00009 #                                                                            #
00010 ##############################################################################
00011 #    $Archive:: /MowseBranches/ms_mascotresfile_1.2/include/ms_mascotresfi $ #
00012 #     $Author: martins $ #
00013 #       $Date: 2014/02/07 17:07:04 $ #
00014 #   $Revision: 1.13 $ #
00015 # $NoKeywords::                                                            $ #
00016 ##############################################################################
00017 */
00018 
00019 
00020 
00021 #if !defined(ms_sec_task_INCLUDED_)
00022 #define ms_sec_task_INCLUDED_
00023 
00024 #ifdef _WIN32
00025 #pragma warning(disable:4251)   // Don't want all classes to be exported
00026 #pragma warning(disable:4786)   // Debug symbols too long
00027 #   ifndef _MATRIX_USE_STATIC_LIB
00028 #       ifdef MS_MASCOTRESFILE_EXPORTS
00029 #           define MS_MASCOTRESFILE_API __declspec(dllexport)
00030 #       else
00031 #           define MS_MASCOTRESFILE_API __declspec(dllimport)
00032 #       endif
00033 #   else
00034 #       define MS_MASCOTRESFILE_API
00035 #   endif
00036 #else
00037 #   define MS_MASCOTRESFILE_API
00038 #endif
00039 
00040 // for the sake of #include <string>
00041 #ifdef __ALPHA_UNIX__
00042 #include <ctype.h>
00043 #endif
00044 
00045 // Includes from the standard template library
00046 #include <string>
00047 #include <set>
00048 #include <time.h>
00049 #include <vector>
00050 
00051 namespace matrix_science {
00052 
00057 
00058 
00070     class MS_MASCOTRESFILE_API ms_security_task
00071     {
00072     public:
00074 
00082         enum paramType
00083         {
00084             TYPE_BOOL           = 0x0000, 
00085             TYPE_EQ_LONG        = 0x0001, 
00086             TYPE_LTE_LONG       = 0x0002, 
00087             TYPE_GTE_LONG       = 0x0003, 
00088             TYPE_LONG_ARRAY     = 0x0004, 
00089             TYPE_EQ_DOUBLE      = 0x0005, 
00090             TYPE_LTE_DOUBLE     = 0x0006, 
00091             TYPE_GTE_DOUBLE     = 0x0007, 
00092             TYPE_DOUBLE_ARRAY   = 0x0008, 
00093             TYPE_EQ_STRING      = 0x0009, 
00094             TYPE_STRING_ARRAY   = 0x000A, 
00095             TYPE_USERS_ARRAY    = 0x000B, 
00096             TYPE_ALL_USERS_ARRAY= 0x000C  
00097         };
00098 
00100         ms_security_task();
00101 
00103         ~ms_security_task();
00104 
00105         // Copying constructor for c++ programs - don't document
00106         ms_security_task(const ms_security_task& src);
00107 
00108 #ifndef SWIG
00109         // Assignment operator for c++ programs - don't document
00110         ms_security_task& operator=(const ms_security_task& right);
00111 #endif
00112 
00113         int getID() const;
00114 
00116         void setID(const int id);
00117 
00119         std::string getConstantName() const;
00120 
00121         void setConstantName(const std::string value);
00122 
00124         std::string getNotes() const;
00125 
00126         void setNotes(const std::string value);
00127 
00129         std::string getDescription() const;
00130 
00131         void setDescription(const std::string value);
00132 
00134         paramType getType() const;
00135 
00136         void setType(const paramType value);
00137 
00139         void clearParams();
00140 
00142         void setParams(const std::string value);
00143 
00145         bool addLongParam(const long value);
00146 
00148         bool addDoubleParam(const double value);
00149 
00151         bool addStringParam(const std::string value);
00152 
00154         std::vector<long> getLongParams() const;
00155 
00157         std::vector<double> getDoubleParams() const;
00158 
00160         std::vector<std::string> getStringParams() const;
00161 
00163         std::string getAllParamsAsString() const;
00164 
00166         bool isPermitted() const;
00167 
00169         bool isPermitted_long(const long value) const;
00170 
00172         bool isPermitted_double(const double value) const;
00173 
00175         bool isPermitted_string(const std::string value) const;
00176 
00177     private:
00178         int id_;
00179         std::string description_;
00180         std::string notes_;
00181         std::string constantName_;
00182         paramType type_;
00183         std::set<long>           longParams_;
00184         std::set<double>         doubleParams_;
00185         std::set<std::string>    stringParams_;
00186 
00187         void copyFrom(const ms_security_task* src);
00188     }; // end of security_group
00190 }
00191 
00192 #endif // !defined(ms_sec_task_INCLUDED_)
Copyright © 2016 Matrix Science Ltd.  All Rights Reserved. Generated on Fri Jun 2 2017 01:44:51