1 #ifndef DEFINES_ISLIB_ISLIBFUNC_HPP
3 #define DEFINES_ISLIB_ISLIBFUNC_HPP
6 // Inclusion of standard header file
17 // Inclusion of system header file
20 #include <sys/types.h>
25 // Inclusion of library header file
27 #include <boost/filesystem/path.hpp>
32 // Declaration of function
34 void link_ ( boost::filesystem::path const &, boost::filesystem::path const & );
35 void localtime_r_ ( std::time_t const *, struct std::tm * );
36 void mkdir_ ( boost::filesystem::path const &, mode_t );
38 void raise_fatal ( int );
39 void sigaction_ ( int, struct sigaction const *, struct sigaction * );
40 void sigaction_fatal ( int, struct sigaction const *, struct sigaction * );
41 void sigfillset_ ( sigset_t * );
42 void sigfillset_fatal ( sigset_t * );
43 void sigprocmask_ ( int, sigset_t const *, sigset_t * );
44 void sigprocmask_fatal ( int, sigset_t const *, sigset_t * );
46 void stat_ ( boost::filesystem::path const &, struct stat * );
47 void unlink_ ( boost::filesystem::path const & );
48 void utime_ ( boost::filesystem::path const &, struct utimbuf const * );
49 void write_ ( int, void const *, std::size_t );
50 void write_assert ( int, void const *, std::size_t );
53 // Declaration of template function
55 template < typename Value_Type, typename Permissible_Error_Type > bool equals_to ( Value_Type const &, Value_Type const &, Permissible_Error_Type const & );
56 template < typename Value_Type, typename Permissible_Error_Type > bool does_not_equal_to ( Value_Type const &, Value_Type const &, Permissible_Error_Type const & );
57 template < typename Value_Type, typename Permissible_Error_Type > bool is_less_than ( Value_Type const &, Value_Type const &, Permissible_Error_Type const & );
58 template < typename Value_Type, typename Permissible_Error_Type > bool is_greater_than ( Value_Type const &, Value_Type const &, Permissible_Error_Type const & );
59 template < typename Value_Type, typename Permissible_Error_Type > bool is_less_than_or_equals_to ( Value_Type const &, Value_Type const &, Permissible_Error_Type const & );
60 template < typename Value_Type, typename Permissible_Error_Type > bool is_greater_than_or_equals_to ( Value_Type const &, Value_Type const &, Permissible_Error_Type const & );
63 // Definition of inline function
69 bool const expression,
70 std::string const &cause
77 std::cerr << cause << std::endl;
81 assert ( expression );
85 // Definition of template function
89 typename Exception_Type
94 Exception_Type const &exception
98 #ifndef DO_NOT_USE_THROW_
102 #else // DO_NOT_USE_THROW_
104 assert_ ( false, exception.what () );
106 #endif // DO_NOT_USE_THROW_
111 // Definition of template function
115 typename Exception_Type
120 Exception_Type const &exception,
125 #ifndef DO_NOT_USE_THROW_IF
130 #else // DO_NOT_USE_THROW_IF
133 assert_ ( false, exception.what () );
135 #endif // DO_NOT_USE_THROW_IF
140 // Definition of template function
144 typename Container_Type,
150 Container_Type &container,
151 Value_Type const &value
154 std::pair < typename Container_Type::iterator, bool > const insert_return_value = container.insert ( value );
156 throw_if ( std::logic_error ( "islib::insert: !insert_return_value.second" ), !insert_return_value.second );
160 #endif // DEFINES_ISLIB_ISLIBFUNC_HPP