implem_only.h

Go to the documentation of this file.
00001 #ifndef RPC_IMPLEMENTATION_ONLY_GROUP
00002 #define RPC_IMPLEMENTATION_ONLY_GROUP
00003 
00004 /*****************************************************************************\
00005 *                                                                             *
00006 *  Name   : implementation only                                               *
00007 *  Author : Chris Koeritz                                                     *
00008 *                                                                             *
00009 *  Purpose:                                                                   *
00010 *                                                                             *
00011 *    This file should only be used by rpc test code implementations.  It      *
00012 *    provides handy macros and other support items.                           *
00013 *                                                                             *
00014 *******************************************************************************
00015 * Copyright (c) 1995-$now By Author.  This program is free software; you can  *
00016 * redistribute it and/or modify it under the terms of the GNU General Public  *
00017 * License as published by the Free Software Foundation; either version 2 of   *
00018 * the License or (at your option) any later version.  This is online at:      *
00019 *     http://www.fsf.org/copyleft/gpl.html                                    *
00020 * Please send any updates to: fred@gruntose.com                               *
00021 \*****************************************************************************/
00022 
00023 #include "shared_code.h"
00024 #include "shared_code.rh"
00025 
00026 #include <basis/guards.h>
00027 #include <basis/packable.h>
00028 #include <win_ext/event_ex.h>
00029 #ifdef DEBUG_RPC
00030   #include <win_ext/debugger.h>
00031 #else
00032   #include <loggers/file_logger.h>
00033 #endif
00034 
00035 #include <process.h>
00036 
00038 
00039 // debugging macros...
00040 
00041 #define LOG(to_print) { \
00042   FUNCTION(func); \
00043   debugger(alert, RPC_DEBUG_METHOD).print(function_name + istring(to_print)); \
00044 }
00045 
00047 
00048 // ensures that the connection is established with the rpc server or it's
00049 // time to explode.  i like to explode.
00050 #define CHECK_CONNECTION \
00051   if (!connected()) deadly_error(class_name(), func, "not connected!")
00052 
00054 
00055 // ensures that we either are logged in or complain about it plenty.
00056 #define CHECK_LOGIN { \
00057   if (!logged_in()) login(); \
00058   if (!logged_in()) deadly_error(class_name(), func, "not logged in."); \
00059 }
00060 
00062 
00063 // stops the program and complains.
00064 #define KABOOM(to_print) { \
00065   LOG(to_print); \
00066   deadly_error(class_name(), func, istring(to_print).s()); \
00067 }
00068 
00070 
00071 #endif
00072 

Generated on Fri Nov 28 04:28:53 2008 for HOOPLE Libraries by  doxygen 1.5.1