tclap: ArgTraits.h Source File

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

# ArgTraits.h

Go to the documentation of this file.

    00001 // -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
    00002
    00003 /******************************************************************************
    00004  *
    00005  *  file:  ArgTraits.h
    00006  *
    00007  *  Copyright (c) 2007, Daniel Aarno, Michael E. Smoot .
    00008  *  All rights reverved.
    00009  *
    00010  *  See the file COPYING in the top directory of this distribution for
    00011  *  more information.
    00012  *
    00013  *  THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS
    00014  *  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    00015  *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
    00016  *  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    00017  *  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
    00018  *  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
    00019  *  DEALINGS IN THE SOFTWARE.
    00020  *
    00021  *****************************************************************************/
    00022
    00023 // This is an internal tclap file, you should probably not have to
    00024 // include this directly
    00025
    00026 #ifndef TCLAP_ARGTRAITS_H
    00027 #define TCLAP_ARGTRAITS_H
    00028
    00029 namespace TCLAP {
    00030
    00031 // We use two empty structs to get compile type specialization
    00032 // function to work
    00033
    00038 struct ValueLike {
    00039     typedef ValueLike ValueCategory;
    00040     virtual ~ValueLike() {}
    00041 };
    00042
    00048 struct StringLike {
    00049     virtual ~StringLike() {}
    00050 };
    00051
    00057 struct StringLikeTrait {
    00058     typedef StringLike ValueCategory;
    00059     virtual ~StringLikeTrait() {}
    00060 };
    00061
    00067 struct ValueLikeTrait {
    00068     typedef ValueLike ValueCategory;
    00069     virtual ~ValueLikeTrait() {}
    00070 };
    00071
    00078 template<typename T>
    00079 struct ArgTraits {
    00080     typedef typename T::ValueCategory ValueCategory;
    00081     virtual ~ArgTraits() {}
    00082     //typedef ValueLike ValueCategory;
    00083 };
    00084
    00085 #endif
    00086
    00087 } // namespace