Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

private.h

Go to the documentation of this file.
00001 /* Copyright (C) 2005 The cairomm Development Team
00002  *
00003  * This library is free software; you can redistribute it and/or
00004  * modify it under the terms of the GNU Library General Public
00005  * License as published by the Free Software Foundation; either
00006  * version 2 of the License, or (at your option) any later version.
00007  *
00008  * This library is distributed in the hope that it will be useful,
00009  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00010  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011  * Library General Public License for more details.
00012  *
00013  * You should have received a copy of the GNU Library General Public
00014  * License along with this library; if not, write to the Free
00015  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00016  */
00017 
00018 #ifndef __CAIROMM_PRIVATE_H
00019 #define __CAIROMM_PRIVATE_H
00020 
00021 #include <cairomm/enums.h>
00022 #include <cairomm/exception.h>
00023 #include <string>
00024 
00025 
00026 namespace Cairo
00027 {
00028 
00029 void throw_exception(ErrorStatus status);
00030 
00031 //We inline this because it is called so often.
00032 inline void check_status_and_throw_exception(ErrorStatus status)
00033 {
00034   if(status != CAIRO_STATUS_SUCCESS)
00035     throw_exception(status); //This part doesn't need to be inline because it would rarely be called.
00036 }
00037 
00038 template<class T>
00039 void check_object_status_and_throw_exception(const T& object)
00040 {
00041   //get_status() is normally an inlined member method.
00042   check_status_and_throw_exception(object.get_status());
00043 }
00044 
00045 } // namespace Cairo
00046 
00047 #endif //__CAIROMM_PRIVATE_H
00048 

Generated on Thu Feb 9 12:47:13 2006 for cairomm by  doxygen 1.4.4