aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2010-08-16 14:24:09 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2010-08-16 14:24:09 +0200
commit189d4fbad840ab397cfb62e24b05912b68716518 (patch)
tree235328b77bcecb8864fcc0d6eb49b767f4e7cf08
parent7d7dd0a96ecd88a8d667dda55a0e901d40b8018e (diff)
Make small functions inline
-rw-r--r--odb/database.ixx21
-rw-r--r--odb/database.txx25
2 files changed, 21 insertions, 25 deletions
diff --git a/odb/database.ixx b/odb/database.ixx
index c8fe08c..fb26d64 100644
--- a/odb/database.ixx
+++ b/odb/database.ixx
@@ -9,4 +9,25 @@ namespace odb
database ()
{
}
+
+ template <typename T>
+ inline void database::
+ erase (const T& obj)
+ {
+ erase<T> (object_traits<T>::id (obj));
+ }
+
+ template <typename T>
+ inline result<T> database::
+ query ()
+ {
+ return query (odb::query<T> ());
+ }
+
+ template <typename T>
+ inline result<T> database::
+ query (const std::string& q)
+ {
+ return query (odb::query<T> (q));
+ }
}
diff --git a/odb/database.txx b/odb/database.txx
index 377df21..c037892 100644
--- a/odb/database.txx
+++ b/odb/database.txx
@@ -8,9 +8,6 @@
namespace odb
{
- // @@ Should I make these inline?
- //
-
template <typename T>
typename object_traits<T>::id_type database::
persist (T& obj)
@@ -29,7 +26,6 @@ namespace odb
load (const typename object_traits<T>::id_type& id)
{
typedef object_traits<T> traits;
-
typename traits::pointer_type r (find<T> (id));
if (traits::pointer_traits::null_ptr (r))
@@ -78,13 +74,6 @@ namespace odb
template <typename T>
void database::
- erase (const T& obj)
- {
- erase<T> (object_traits<T>::id (obj));
- }
-
- template <typename T>
- void database::
erase (const typename object_traits<T>::id_type& id)
{
if (!transaction::has_current ())
@@ -95,20 +84,6 @@ namespace odb
template <typename T>
result<T> database::
- query ()
- {
- return query (odb::query<T> ());
- }
-
- template <typename T>
- result<T> database::
- query (const std::string& q)
- {
- return query (odb::query<T> (q));
- }
-
- template <typename T>
- result<T> database::
query (const odb::query<T>& q)
{
if (!transaction::has_current ())