LCOV - code coverage report
Current view: top level - snapwebsites - snap_cassandra.h (source / functions) Hit Total Coverage
Test: coverage.info Lines: 0 6 0.0 %
Date: 2019-12-15 17:13:15 Functions: 0 8 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : // Snap Websites Server -- snap websites server
       2             : // Copyright (c) 2011-2019  Made to Order Software Corp.  All Rights Reserved
       3             : //
       4             : // This program is free software; you can redistribute it and/or modify
       5             : // it under the terms of the GNU General Public License as published by
       6             : // the Free Software Foundation; either version 2 of the License, or
       7             : // (at your option) any later version.
       8             : //
       9             : // This program is distributed in the hope that it will be useful,
      10             : // but WITHOUT ANY WARRANTY; without even the implied warranty of
      11             : // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      12             : // GNU General Public License for more details.
      13             : //
      14             : // You should have received a copy of the GNU General Public License
      15             : // along with this program; if not, write to the Free Software
      16             : // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
      17             : 
      18             : #pragma once
      19             : 
      20             : #include "snapwebsites/snap_config.h"
      21             : #include "snapwebsites/snap_exception.h"
      22             : 
      23             : #include <libdbproxy/libdbproxy.h>
      24             : 
      25             : 
      26             : namespace snap
      27             : {
      28             : 
      29           0 : class snap_cassandra_exception : public snap_exception
      30             : {
      31             : public:
      32           0 :     snap_cassandra_exception(char const *        what_msg) : snap_exception("snap_cassandra", what_msg) {}
      33             :     snap_cassandra_exception(std::string const & what_msg) : snap_exception("snap_cassandra", what_msg) {}
      34           0 :     snap_cassandra_exception(QString const &     what_msg) : snap_exception("snap_cassandra", what_msg) {}
      35             : };
      36             : 
      37           0 : class snap_cassandra_not_available_exception : public snap_cassandra_exception
      38             : {
      39             : public:
      40           0 :     snap_cassandra_not_available_exception(char const *        what_msg) : snap_cassandra_exception(what_msg) {}
      41             :     snap_cassandra_not_available_exception(std::string const & what_msg) : snap_cassandra_exception(what_msg) {}
      42           0 :     snap_cassandra_not_available_exception(QString const &     what_msg) : snap_cassandra_exception(what_msg) {}
      43             : };
      44             : 
      45             : 
      46             : 
      47             : 
      48             : class snap_cassandra
      49             : {
      50             : public:
      51             :     typedef std::shared_ptr<snap_cassandra>     pointer_t;
      52             : 
      53             :                                         snap_cassandra();
      54             :                                         ~snap_cassandra();
      55             : 
      56             :     void                                connect();
      57             :     void                                disconnect();
      58             :     libdbproxy::context::pointer_t      get_snap_context();
      59             :     libdbproxy::table::pointer_t        get_table(QString const & table_name);
      60             : 
      61             :     QString                             get_snapdbproxy_addr() const;
      62             :     int32_t                             get_snapdbproxy_port() const;
      63             :     bool                                is_connected() const;
      64             : 
      65             : private:
      66             :     libdbproxy::libdbproxy::pointer_t   f_cassandra = libdbproxy::libdbproxy::pointer_t();
      67             :     QString                             f_snapdbproxy_addr = "localhost";
      68             :     int                                 f_snapdbproxy_port = 4042;
      69             :     QMap<QString, bool>                 f_created_table = QMap<QString, bool>();
      70             : };
      71             : 
      72             : 
      73             : }
      74             : // namespace snap
      75             : 
      76             : // vim: ts=4 sw=4 et

Generated by: LCOV version 1.13