QxtNullable Class Reference
[QxtCore module]

distinct null value compatible with any data type. More...

 #include <QxtNullable>

Public Functions

related


Detailed Description

in general it's a templated abstraction to allow any data type to be expressed with a null value distinct from any real value. An example of such a use is for optional arguments.
prepare a function for argument skipping:

void somefunction( qxtNull(int,a) , qxtNull(int,b) )
{
    
    if (!a.isNull())
     {
         int i = a.value();
         //do something with i
     }
     if (!b.isNull())
     {
         int x = b.value();
         //do something with x
     }
}

usage:

somefunction(SKIP,1,2);
somefunction(3,4);
somefunction(3,SKIP,6);
somefunction(1);

Member Documentation

QxtNullable ( QxtNull )




QxtNullable ( const T & p )




QxtNullable ( )




bool isNull ( ) const

determinates if the Value is set to something meaningfull




void nullify ( )

delete Value




T & value ( ) const




operator T ( ) const




void operator= ( const T & p )




qxtNull

defines a skipable argument with type t and variable name n






Copyright © 2007 Qxt Foundation Trademarks
Qt Extension Library 0.4