EnumClasses.h
Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 //  (c) 2006 by Basler Vision Technologies
00003 //  Section: Vision Components
00004 //  Project: GenApi
00005 //  Author:  Margret Albrecht
00006 //  $Header$
00007 //
00008 //  License: This file is published under the license of the EMVA GenICam  Standard Group.
00009 //  A text file describing the legal terms is included in  your installation as 'GenICam_license.pdf'.
00010 //  If for some reason you are missing  this file please contact the EMVA or visit the website
00011 //  (http://www.genicam.org) for a full copy.
00012 //
00013 //  THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS"
00014 //  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
00015 //  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00016 //  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD  GROUP
00017 //  OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,  SPECIAL,
00018 //  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT  LIMITED TO,
00019 //  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,  DATA, OR PROFITS;
00020 //  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY  THEORY OF LIABILITY,
00021 //  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT  (INCLUDING NEGLIGENCE OR OTHERWISE)
00022 //  ARISING IN ANY WAY OUT OF THE USE  OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00023 //  POSSIBILITY OF SUCH DAMAGE.
00024 //-----------------------------------------------------------------------------
00030 #ifndef GENAPI_ENUMCLASSES_H
00031 #define GENAPI_ENUMCLASSES_H
00032 #include <GenApi/Types.h>
00033 
00034 namespace GENAPI_NAMESPACE
00035 {
00036     //*************************************************************
00037     // Build in enummeration classes
00038     //*************************************************************
00039 
00041 
00042     class GENAPI_DECL ESignClass
00043     {
00044     public:
00046         static bool FromString(const GENICAM_NAMESPACE::gcstring &ValueStr, ESign *pValue)
00047         {
00048             if (!pValue) return false;
00049             if( ValueStr == "Signed" )
00050                 *pValue = Signed;
00051             else if( ValueStr == "Unsigned" )
00052                 *pValue = Unsigned;
00053             else
00054                 return false;
00055             return true;
00056         }
00058         static void ToString(GENICAM_NAMESPACE::gcstring &ValueStr, ESign *pValue)
00059         {
00060 
00061             if( ! pValue ) throw INVALID_ARGUMENT_EXCEPTION( "NULL argument pValue" );
00062             if( *pValue == Signed )
00063                 ValueStr = "Signed";
00064             else if( *pValue == Unsigned )
00065                 ValueStr = "Unsigned";
00066             else
00067                 ValueStr = "_UndefinedSign";
00068         }
00069 
00071         static GENICAM_NAMESPACE::gcstring ToString(ESign Value)
00072         {
00073             GENICAM_NAMESPACE::gcstring Result;
00074             ToString(Result, &Value);
00075             return Result;
00076         }
00077     };
00078 
00082     class GENAPI_DECL EEndianessClass
00083     {
00084     public:
00086         static bool FromString(const GENICAM_NAMESPACE::gcstring &ValueStr, EEndianess *pValue)
00087         {
00088             if (!pValue) return false;
00089             if( ValueStr == "BigEndian" )
00090                 *pValue = BigEndian;
00091             else if( ValueStr == "LittleEndian" )
00092                 *pValue = LittleEndian;
00093             else
00094                 return false;
00095             return true;
00096         }
00098         static void ToString(GENICAM_NAMESPACE::gcstring &ValueStr, EEndianess *pValue)
00099         {
00100 
00101             if( ! pValue ) throw INVALID_ARGUMENT_EXCEPTION( "NULL argument pValue" );
00102             if( *pValue == BigEndian )
00103                 ValueStr = "BigEndian";
00104             else if( *pValue == LittleEndian )
00105                 ValueStr = "LittleEndian";
00106             else
00107                 ValueStr = "_UndefinedEndian";
00108         }
00109 
00111         static GENICAM_NAMESPACE::gcstring ToString(EEndianess Value)
00112         {
00113             GENICAM_NAMESPACE::gcstring Result;
00114             ToString(Result, &Value);
00115             return Result;
00116         }
00117     };
00118 
00122     class GENAPI_DECL ERepresentationClass
00123     {
00124     public:
00126         static bool FromString(const GENICAM_NAMESPACE::gcstring &ValueStr, ERepresentation *pValue)
00127         {
00128             if (!pValue) return false;
00129             if( ValueStr == "Linear" )
00130                 *pValue = Linear;
00131             else if( ValueStr == "Logarithmic" )
00132                 *pValue = Logarithmic;
00133             else if( ValueStr == "Boolean" )
00134                 *pValue = Boolean;
00135             else if( ValueStr == "PureNumber" )
00136                 *pValue = PureNumber;
00137             else if( ValueStr == "HexNumber" )
00138                 *pValue = HexNumber;
00139             else if( ValueStr == "IPV4Address" )
00140                 *pValue = IPV4Address;
00141             else if( ValueStr == "MACAddress" )
00142                 *pValue = MACAddress;
00143             else
00144                 return false;
00145             return true;
00146         }
00148         static void ToString(GENICAM_NAMESPACE::gcstring &ValueStr, ERepresentation *pValue)
00149         {
00150             if( ! pValue ) throw INVALID_ARGUMENT_EXCEPTION( "NULL argument pValue" );
00151             if( *pValue == Linear )
00152                 ValueStr = "Linear";
00153             else if( *pValue == Logarithmic )
00154                 ValueStr = "Logarithmic";
00155             else if( *pValue == Boolean )
00156                 ValueStr = "Boolean";
00157             else if( *pValue == PureNumber )
00158                 ValueStr = "PureNumber";
00159             else if( *pValue == HexNumber )
00160                 ValueStr = "HexNumber";
00161             else if( *pValue == IPV4Address )
00162                 ValueStr = "IPV4Address";
00163             else if( *pValue == MACAddress )
00164                 ValueStr = "MACAddress";
00165             else
00166                 ValueStr = "_UndefinedRepresentation";
00167         }
00168 
00170         static GENICAM_NAMESPACE::gcstring ToString(ERepresentation Value)
00171         {
00172             GENICAM_NAMESPACE::gcstring Result;
00173             ToString(Result, &Value);
00174             return Result;
00175         }
00176     };
00177 
00181     class GENAPI_DECL EVisibilityClass
00182     {
00183     public:
00185         static bool FromString(const GENICAM_NAMESPACE::gcstring &ValueStr, EVisibility *pValue)
00186         {
00187             if (!pValue) return false;
00188             if( ValueStr == "Beginner" )
00189                 *pValue = Beginner;
00190             else if( ValueStr == "Expert" )
00191                 *pValue = Expert;
00192             else if( ValueStr == "Guru" )
00193                 *pValue = Guru;
00194             else if( ValueStr == "Invisible" )
00195                 *pValue = Invisible;
00196             else
00197                 return false;
00198             return true;
00199         }
00201         static void ToString(GENICAM_NAMESPACE::gcstring &ValueStr, EVisibility *pValue)
00202         {
00203             if( ! pValue ) throw INVALID_ARGUMENT_EXCEPTION( "NULL argument pValue" );
00204             if( *pValue == Beginner )
00205                 ValueStr = "Beginner";
00206             else if( *pValue == Expert )
00207                 ValueStr = "Expert";
00208             else if( *pValue == Guru )
00209                 ValueStr = "Guru";
00210             else if( *pValue == Invisible )
00211                 ValueStr = "Invisible";
00212             else
00213                 ValueStr = "_UndefinedVisibility";
00214         }
00216         static GENICAM_NAMESPACE::gcstring ToString(EVisibility Value)
00217         {
00218             GENICAM_NAMESPACE::gcstring Result;
00219             ToString(Result, &Value);
00220             return Result;
00221         }
00222     };
00223 
00227     class GENAPI_DECL EAccessModeClass
00228     {
00229     public:
00231         static bool FromString(const GENICAM_NAMESPACE::gcstring &ValueStr, EAccessMode *pValue)
00232         {
00233 
00234             if (!pValue) return false;
00235             if( ValueStr == "RW" )
00236                 *pValue = RW;
00237             else if( ValueStr == "RO" )
00238                 *pValue = RO;
00239             else if( ValueStr == "WO" )
00240                 *pValue = WO;
00241             else if( ValueStr == "NA" )
00242                 *pValue = NA;
00243             else if( ValueStr == "NI" )
00244                 *pValue = NI;
00245             else
00246                 return false;
00247             return true;
00248         }
00250         static void ToString(GENICAM_NAMESPACE::gcstring &ValueStr, EAccessMode *pValue)
00251         {
00252             if( ! pValue ) throw INVALID_ARGUMENT_EXCEPTION( "NULL argument pValue" );
00253             if( *pValue == RW )
00254                 ValueStr = "RW";
00255             else if( *pValue == RO )
00256                 ValueStr = "RO";
00257             else if( *pValue == WO )
00258                 ValueStr = "WO";
00259             else if( *pValue == NI )
00260                 ValueStr = "NI";
00261             else if( *pValue == NA )
00262                 ValueStr = "NA";
00263             else
00264                 ValueStr = "_UndefinedAccessMode";
00265         }
00266 
00268         static GENICAM_NAMESPACE::gcstring ToString(EAccessMode Value)
00269         {
00270             GENICAM_NAMESPACE::gcstring Result;
00271             ToString(Result, &Value);
00272             return Result;
00273         }
00274     };
00275 
00279   class GENAPI_DECL ECachingModeClass
00280   {
00281   public:
00283     static bool FromString(const GENICAM_NAMESPACE::gcstring &ValueStr, ECachingMode *pValue )
00284     {
00285       if( ! pValue ) return false;
00286       if( ValueStr == "NoCache" )
00287         *pValue = NoCache;
00288       else if( ValueStr == "WriteThrough" )
00289         *pValue = WriteThrough;
00290       else if( ValueStr == "WriteAround" )
00291         *pValue = WriteAround;
00292       else
00293         return false;
00294       return true;
00295     }
00296     static void ToString(GENICAM_NAMESPACE::gcstring &ValueStr, ECachingMode *pValue)
00297     {
00298       if( ! pValue ) throw INVALID_ARGUMENT_EXCEPTION( "NULL argument pValue" );
00299       if( *pValue == NoCache )
00300         ValueStr = "NoCache";
00301       else if( *pValue == WriteThrough )
00302         ValueStr = "WriteThrough";
00303       else if( *pValue == WriteAround )
00304         ValueStr = "WriteAround";
00305       else
00306         ValueStr = "_UndefinedCachingMode";
00307     }
00309         static GENICAM_NAMESPACE::gcstring ToString(ECachingMode Value)
00310         {
00311             GENICAM_NAMESPACE::gcstring Result;
00312             ToString(Result, &Value);
00313             return Result;
00314         }
00315 
00316   };
00317 
00321     class GENAPI_DECL ENameSpaceClass
00322     {
00323     public:
00325         static bool FromString(const GENICAM_NAMESPACE::gcstring &ValueStr, ENameSpace *pValue)
00326         {
00327             if (!pValue) return false;
00328             if( ValueStr == "Custom" )
00329                 *pValue = Custom;
00330             else if( ValueStr == "Standard" )
00331                 *pValue = Standard;
00332             else
00333                 return false;
00334             return true;
00335         }
00337         static void ToString(GENICAM_NAMESPACE::gcstring &ValueStr, ENameSpace *pValue)
00338         {
00339             if( ! pValue ) throw INVALID_ARGUMENT_EXCEPTION( "NULL argument pValue" );
00340             if( *pValue == Custom )
00341                 ValueStr = "Custom";
00342             else if( *pValue == Standard )
00343                 ValueStr = "Standard";
00344             else
00345                 ValueStr = "_UndefinedNameSpace";
00346         }
00348         static GENICAM_NAMESPACE::gcstring ToString(ENameSpace Value)
00349         {
00350             GENICAM_NAMESPACE::gcstring Result;
00351             ToString(Result, &Value);
00352             return Result;
00353         }
00354     };
00355 
00359     class GENAPI_DECL EYesNoClass
00360     {
00361     public:
00363         static bool FromString(const GENICAM_NAMESPACE::gcstring &ValueStr, EYesNo *pValue)
00364         {
00365             if (!pValue) return false;
00366             if( ValueStr == "Yes" )
00367                 *pValue = Yes;
00368             else if( ValueStr == "No" )
00369                 *pValue = No;
00370             else
00371                 return false;
00372             return true;
00373         }
00375         static void ToString(GENICAM_NAMESPACE::gcstring &ValueStr, EYesNo *pValue)
00376         {
00377             if( ! pValue ) throw INVALID_ARGUMENT_EXCEPTION( "NULL argument pValue" );
00378             if( *pValue == Yes)
00379                 ValueStr = "Yes";
00380             else if( *pValue == No )
00381                 ValueStr = "No";
00382             else
00383                 ValueStr = "_UndefinedYesNo";
00384         }
00385 
00387         static GENICAM_NAMESPACE::gcstring ToString(EYesNo Value)
00388         {
00389             GENICAM_NAMESPACE::gcstring Result;
00390             ToString(Result, &Value);
00391             return Result;
00392         }
00393     };
00394 
00398     class GENAPI_DECL EStandardNameSpaceClass
00399     {
00400     public:
00402         static bool FromString(const GENICAM_NAMESPACE::gcstring &ValueStr, EStandardNameSpace *pValue)
00403         {
00404             if (!pValue) return false;
00405             if( ValueStr == "None" )
00406                 *pValue = None;
00407             else if( ValueStr == "GEV" )
00408                 *pValue = GEV;
00409             else if( ValueStr == "IIDC" )
00410                 *pValue = IIDC;
00411             else if( ValueStr == "CL" )
00412                 *pValue = CL;
00413             else if( ValueStr == "USB" )
00414                 *pValue = USB;
00415             else
00416                 return false;
00417             return true;
00418         }
00420         static void ToString(GENICAM_NAMESPACE::gcstring &ValueStr, EStandardNameSpace *pValue)
00421         {
00422             if( ! pValue ) throw INVALID_ARGUMENT_EXCEPTION( "NULL argument pValue" );
00423             if( *pValue == None )
00424                 ValueStr = "None";
00425             else if( *pValue == GEV )
00426                 ValueStr = "GEV";
00427             else if( *pValue == IIDC )
00428                 ValueStr = "IIDC";
00429             else if( *pValue == CL )
00430                 ValueStr = "CL";
00431             else if( *pValue == USB )
00432                 ValueStr = "USB";
00433             else
00434                 ValueStr = "_UndefinedStandardNameSpace";
00435         }
00437         static GENICAM_NAMESPACE::gcstring ToString(EStandardNameSpace Value)
00438         {
00439             GENICAM_NAMESPACE::gcstring Result;
00440             ToString(Result, &Value);
00441             return Result;
00442         }
00443     };
00444 
00448     class GENAPI_DECL ESlopeClass
00449     {
00450     public:
00452         static bool FromString(const GENICAM_NAMESPACE::gcstring &ValueStr, ESlope *pValue)
00453         {
00454             if (!pValue)
00455                 return false;
00456 
00457             if( ValueStr == "Increasing" )
00458                 *pValue = Increasing;
00459             else if( ValueStr == "Decreasing" )
00460                 *pValue = Decreasing;
00461             else if( ValueStr == "Varying" )
00462                 *pValue = Varying;
00463             else if( ValueStr == "Automatic" )
00464                 *pValue = Automatic;
00465             else
00466                 return false;
00467 
00468             return true;
00469         }
00471         static void ToString(GENICAM_NAMESPACE::gcstring &ValueStr, ESlope *pValue)
00472         {
00473             if( ! pValue )
00474                 throw INVALID_ARGUMENT_EXCEPTION( "NULL argument pValue" );
00475 
00476             if( *pValue == Increasing )
00477                 ValueStr = "Increasing";
00478             else if( *pValue == Decreasing )
00479                 ValueStr = "Decreasing";
00480             else if( *pValue == Varying )
00481                 ValueStr = "Varying";
00482             else if( *pValue == Automatic )
00483                 ValueStr = "Automatic";
00484             else
00485                 ValueStr = "_UndefinedESlope";
00486         }
00488         static GENICAM_NAMESPACE::gcstring ToString(ESlope Value)
00489         {
00490             GENICAM_NAMESPACE::gcstring Result;
00491             ToString(Result, &Value);
00492             return Result;
00493         }
00494     };
00495 
00499     class GENAPI_DECL EDisplayNotationClass
00500     {
00501     public:
00503         static bool FromString(const GENICAM_NAMESPACE::gcstring &ValueStr, EDisplayNotation *pValue)
00504         {
00505             if (!pValue)
00506                 return false;
00507 
00508             if( ValueStr == "Automatic" )
00509                 *pValue = fnAutomatic;
00510             else if( ValueStr == "Fixed" )
00511                 *pValue = fnFixed;
00512             else if( ValueStr == "Scientific" )
00513                 *pValue = fnScientific;
00514             else
00515                 return false;
00516 
00517             return true;
00518         }
00520         static void ToString(GENICAM_NAMESPACE::gcstring &ValueStr, EDisplayNotation *pValue)
00521         {
00522             if( ! pValue )
00523                 throw INVALID_ARGUMENT_EXCEPTION( "NULL argument pValue" );
00524 
00525             if( *pValue == fnAutomatic )
00526                 ValueStr = "Automatic";
00527             else if( *pValue == fnFixed )
00528                 ValueStr = "Fixed";
00529             else if( *pValue == fnScientific )
00530                 ValueStr = "Scientific";
00531             else
00532                 ValueStr = "_UndefinedEDisplayNotation";
00533         }
00535         static GENICAM_NAMESPACE::gcstring ToString(EDisplayNotation Value)
00536         {
00537             GENICAM_NAMESPACE::gcstring Result;
00538             ToString(Result, &Value);
00539             return Result;
00540         }
00541     };
00542 
00546     class GENAPI_DECL EInputDirectionClass
00547     {
00548     public:
00550         static bool FromString(const GENICAM_NAMESPACE::gcstring &ValueStr, EInputDirection *pValue)
00551         {
00552             if (!pValue)
00553                 return false;
00554 
00555             if( ValueStr == "From" )
00556                 *pValue = idFrom;
00557             else if( ValueStr == "To" )
00558                 *pValue = idTo;
00559             else if( ValueStr == "None" )
00560                 *pValue = idNone;
00561             else
00562                 return false;
00563 
00564             return true;
00565         }
00567         static void ToString(GENICAM_NAMESPACE::gcstring &ValueStr, EInputDirection *pValue)
00568         {
00569             if( ! pValue )
00570                 throw INVALID_ARGUMENT_EXCEPTION( "NULL argument pValue" );
00571 
00572             if( *pValue == idFrom )
00573                 ValueStr = "From";
00574             else if( *pValue == idTo )
00575                 ValueStr = "To";
00576             else if( *pValue == idNone )
00577                 ValueStr = "None";
00578             else
00579                 ValueStr = "_UndefinedEInputDirection";
00580         }
00582         static GENICAM_NAMESPACE::gcstring ToString(EInputDirection Value)
00583         {
00584             GENICAM_NAMESPACE::gcstring Result;
00585             ToString(Result, &Value);
00586             return Result;
00587         }
00588     };
00589 
00591     class GENAPI_DECL EGenApiSchemaVersionClass
00592     {
00593     public:
00595         static bool FromString(const GENICAM_NAMESPACE::gcstring &ValueStr, EGenApiSchemaVersion *pValue)
00596         {
00597             if (!pValue) return false;
00598             if (ValueStr == "v1_0")
00599                 *pValue = v1_0;
00600             else if (ValueStr == "v1_1")
00601                 *pValue = v1_1;
00602             else
00603                 return false;
00604             return true;
00605         }
00607         static void ToString(GENICAM_NAMESPACE::gcstring &ValueStr, EGenApiSchemaVersion *pValue)
00608         {
00609 
00610             assert(!pValue);
00611             if (*pValue == v1_0)
00612                 ValueStr = "v1_0";
00613             else if (*pValue == v1_1)
00614                 ValueStr = "v1_1";
00615             else
00616                 ValueStr = "_Undefined";
00617         }
00618 
00620         static GENICAM_NAMESPACE::gcstring ToString(EGenApiSchemaVersion Value)
00621         {
00622             GENICAM_NAMESPACE::gcstring Result;
00623             ToString(Result, &Value);
00624             return Result;
00625         }
00626     };
00627 
00628 
00629 }
00630 
00631 #endif // ifndef GENAPI_ENUMCLASSES_H


rc_genicam_api
Author(s): Heiko Hirschmueller
autogenerated on Thu Jun 6 2019 18:42:46