enhance_cpp.h

Go to the documentation of this file.
00001 #ifndef ENHANCE_CPP_GROUP
00002 #define ENHANCE_CPP_GROUP
00003 
00004 /*****************************************************************************\
00005 *                                                                             *
00006 *  Name   : enhance_cpp                                                       *
00007 *  Author : Chris Koeritz                                                     *
00008 *                                                                             *
00009 *******************************************************************************
00010 * Copyright (c) 1996-$now By Author.  This program is free software; you can  *
00011 * redistribute it and/or modify it under the terms of the GNU General Public  *
00012 * License as published by the Free Software Foundation; either version 2 of   *
00013 * the License or (at your option) any later version.  This is online at:      *
00014 *     http://www.fsf.org/copyleft/gpl.html                                    *
00015 * Please send any updates to: fred@gruntose.com                               *
00016 \*****************************************************************************/
00017 
00018 #include <basis/definitions.h>
00019 
00020 namespace basis {
00021 
00023 
00030 //hmmm: temporary to hide missing code.
00031 #define frame_tracking_instance
00032 #define __trail_of_function(a, b, c, d, e)
00033 
00034 class enhance_cpp : public virtual root_object
00035 {
00036 public:
00037   // this class is an encapsulator; any macros are not actual members.
00038 
00040 
00042 
00045   #define DEFINE_CLASS_NAME(objname) \
00046     static const char *static_class_name() { return (objname); } \
00047     virtual const char *class_name() const { return static_class_name(); }
00048 
00050 
00052 
00057   #define FUNCDEF(func_in) \
00058     const char *func = (const char *)func_in; \
00059     frame_tracking_instance __trail_of_function(static_class_name(), func, \
00060         __FILE__, __LINE__, true)
00061 
00063 
00065   #define BASE_FUNCTION(func) astring just_function = astring(func); \
00066     astring function_name = static_class_name(); \
00067     function_name += astring("::") + just_function
00068 
00069 
00072   #define FUNCTION(func) BASE_FUNCTION(func); \
00073     function_name += ": "; \
00074     update_current_stack_frame_line_number(__LINE__)
00075 
00077   #define BASE_INSTANCE_FUNCTION(func) astring just_function = astring(func); \
00078     astring function_name = instance_name(); \
00079     function_name += astring("::") + just_function
00080 
00081 
00084   #define INSTANCE_FUNCTION(func) BASE_INSTANCE_FUNCTION(func); \
00085     function_name += ": "; \
00086     update_current_stack_frame_line_number(__LINE__)
00087 
00089 
00091 
00094   #define __WHERE__ basis::a_sprintf("%s [line %d]", __FILE__, __LINE__)
00095 
00096 };
00097 
00098 } //namespace.
00099 
00100 #endif
00101 
Generated on Sat Jan 28 04:22:15 2012 for hoople2 project by  doxygen 1.6.3