ns2 Network Simulator      C++ Class Hierarchy of version ns-snapshot-20040722
Home |  Source Code |  Manual |  FAQ |  Mailing List Archive |  Search |  Download | 


Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

tclcl/tclcl-mappings.h File Reference


Compounds

class  TclArguments
class  TclObjectHelper

Defines

#define DECLARE_OTCLCLASS(classname, otclname)
#define DEFINE_ABSTRACT_OTCL_CLASS(classname, otclname)
#define DEFINE_OTCL_CLASS(classname, otclname)
#define INSTPROC(c_method)
#define INSTPROC_PUBLIC(c_method)   INSTPROC(c_method)
#define INSTPROC_PRIVATE(c_method)   INSTPROC(c_method)
#define PROC(c_static_method)
#define PROC_PUBLIC(c_static_method)   PROC(c_static_method)
#define PROC_PRIVATE(c_static_method)   PROC(c_static_method)
#define BEGIN_PARSE_ARGS(argc, argv)   TclArguments _args_(argc, argv)
#define END_PARSE_ARGS
#define ARG(var)
#define ARG_DEFAULT(var, default)

Define Documentation

#define ARG var   
 

Value:

do {                                                                        \
        if (_args_.arg(var)==TCL_ERROR) {                                   \
                return TCL_ERROR;                                           \
        }                                                                   \
} while (0)

#define ARG_DEFAULT var,
default   
 

Value:

do {                                                                        \
        if (!_args_.more_args()) {                                          \
                var = default;                                              \
        }                                                                   \
        else if (_args_.arg(var)==TCL_ERROR) {                              \
                return TCL_ERROR;                                           \
        }                                                                   \
} while (0)

#define BEGIN_PARSE_ARGS argc,
argv       TclArguments _args_(argc, argv)
 

#define DECLARE_OTCLCLASS classname,
otclname   
 

Value:

\
static class classname ## _Class : public TclClass,                         \
                                   public TclObjectHelper<classname> {      \
public:                                                                     \
        typedef TclObjectHelper<classname> MyHelper;                        \
        typedef classname MyTclObject;                                      \
                                                                            \
        classname ## _Class() : TclClass(otclname) { }                      \
        TclObject *create(int argc, const char*const* argv);                \
        void otcl_mappings();                                               \
} classname ## _class_obj

#define DEFINE_ABSTRACT_OTCL_CLASS classname,
otclname   
 

Value:

DECLARE_OTCLCLASS(classname, otclname);                                     \
                                                                            \
inline TclObject *classname ## _Class::create(int  ,                 \
                                              const char*const*  ) { \
        Tcl::instance().resultf("cannot create object of abstract class "   \
                                "'%s'", classname_);                        \
        return NULL;                                                        \
}                                                                           \
                                                                            \
void classname ## _Class::otcl_mappings()

#define DEFINE_OTCL_CLASS classname,
otclname   
 

Value:

DECLARE_OTCLCLASS(classname, otclname);                                     \
                                                                            \
inline TclObject *classname ## _Class::create(int  ,                 \
                                              const char*const*  ) { \
        return (new MyTclObject);                                           \
}                                                                           \
                                                                            \
void classname ## _Class::otcl_mappings()

#define END_PARSE_ARGS
 

Value:

if (_args_.more_args()) {                                                   \
        Tcl::instance().resultf("Extra arguments (starting at "             \
                                "argument %d)", _args_.current()-1);        \
        _args_.add_error();                                                 \
        return TCL_ERROR;                                                   \
}

#define INSTPROC c_method   
 

Value:

{                                                                           \
        static MyHelper::TMethod method = &MyTclObject::c_method;           \
        OTclAddIMethod(class_, #c_method, MyHelper::dispatch_,              \
                       (void*) &method, NULL);                              \
}

#define INSTPROC_PRIVATE c_method       INSTPROC(c_method)
 

#define INSTPROC_PUBLIC c_method       INSTPROC(c_method)
 

#define PROC c_static_method   
 

Value:

{                                                                           \
        int (*method)(int,const char*const*) = &MyTclObject::c_static_method;\
        OTclAddPMethod((OTclObject*)class_, #c_static_method,               \
                       TclObject::dispatch_static_proc,                     \
                       (void*) method, NULL);                               \
}

#define PROC_PRIVATE c_static_method       PROC(c_static_method)
 

#define PROC_PUBLIC c_static_method       PROC(c_static_method)
 


This document is generated by doxygen.