aboutsummaryrefslogtreecommitdiff
path: root/lib/meter/meter_base.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/meter/meter_base.cpp')
-rw-r--r--lib/meter/meter_base.cpp95
1 files changed, 0 insertions, 95 deletions
diff --git a/lib/meter/meter_base.cpp b/lib/meter/meter_base.cpp
deleted file mode 100644
index 14a08cf..0000000
--- a/lib/meter/meter_base.cpp
+++ /dev/null
@@ -1,95 +0,0 @@
-/* ****************************************************************************
- * meter/meter_base.cpp -- méthodes de la classe `meter_base`.
- * Copyright (C) 2018 Thomas Touhey <thomas@touhey.fr>
- *
- * This project is governed by the CeCILL license under French law and
- * abiding by the rules of distribution of free software. You can use,
- * modify and/or redistribute the software under the terms of the
- * CeCILL license as circulated by CEA, CNRS and INRIA at the
- * following URL: "http://www.cecill.info".
- *
- * As a counterpart to the access to the source code and rights to copy,
- * modify and redistribute granted by the license, users are provided only
- * with a limited warranty and the project's author, the holder of the
- * economic rights, and the successive licensors have only limited liability.
- *
- * In this respect, the user's attention is drawn to the risks associated
- * with loading, using, modifying and/or developing or reproducing the
- * software by the user in light of its specific status of free software,
- * that may mean that it is complicated to manipulate, and that also therefore
- * means that it is reserved for developers and experienced professionals
- * having in-depth computer knowledge. Users are therefore encouraged to load
- * and test the software's suitability as regards their requirements in
- * conditions enabling the security of their systems and/or data to be
- * ensured and, more generally, to use and operate it in the same conditions
- * as regards security.
- *
- * The fact that you are presently reading this means that you have had
- * knowledge of the CeCILL license and that you accept its terms.
- * ************************************************************************* */
-#include "../internals.hpp"
-
-using namespace wesh;
-
-/* ---
- * Constructeur, destructeur.
- * --- */
-
-meter_base::meter_base(void)
-{
- this->parent = nullptr;
- this->id = -1;
-}
-
-meter_base::meter_base(wes_base *parent_to_use, int num_to_use)
-{
- if (!parent_to_use || num_to_use <= 0 || num_to_use > 32766)
- throw no_meter_exception();
-
- /* FIXME: Vérifier si les arguments sont valides. */
-
- this->parent = parent_to_use;
- this->id = num_to_use;
-
- this->gather();
-}
-
-/* ---
- * Récupération de l'objet.
- * --- */
-
-/* Remarque : l'absence de `default` dans les switch est volontaire. */
-
-void meter_base::gather(void)
-{
- wespid_with_meter_id_t args = {
- static_cast<wespid_t>(this->parent->get_id()),
- this->num};
- wespret_with_tic_t *resp;
-
- if (this->num < 0)
- throw not_loaded_exception();
-
- /* Requête au démon. */
-
- resp = get_tic_1(&args, clnt(this->parent));
- if (!resp)
- throw connexion_exception();
-
- /* TODO: other values */
-}
-
-void meter_base::gather(wes_base *parent_now, int num_now)
-{
- if (this->num >= 0)
- throw not_loaded_exception();
-
- /* FIXME: vérifier si les arguments sont valides. */
-
- this->parent = parent_now;
- this->num = num_now;
-
- this->gather();
-}
-
-/* TODO: meter_base::update() */