AgentXcpp  Revision:0.1
Internals Documentation
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends
/home/tanjeff/projekte/agentxcpp/src/variable.hpp
Go to the documentation of this file.
00001 /*
00002  * Copyright 2011-2012 Tanjeff-Nicolai Moos <tanjeff@cccmz.de>
00003  *
00004  * This file is part of the agentXcpp library.
00005  *
00006  * AgentXcpp is free software: you can redistribute it and/or modify
00007  * it under the terms of the AgentXcpp library license, version 1, which 
00008  * consists of the GNU General Public License and some additional 
00009  * permissions.
00010  *
00011  * AgentXcpp is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * See the AgentXcpp library license in the LICENSE file of this package 
00017  * for more details.
00018  */
00019 #ifndef _VARIABLE_H_
00020 #define _VARIABLE_H_
00021 
00022 #include "types.hpp"
00023 
00024 namespace agentxcpp
00025 {
00026     /**
00027      * \brief This class represents a SNMP variable.
00028      *
00029      * This class is used as base class for the SNMP variable types (such as 
00030      * Octet_String or Integer). It has no functions or members exposed to the 
00031      * API.
00032      */
00033     class variable
00034     {
00035         public:
00036             /**
00037              * \internal
00038              *
00039              * \brief Serialize the variable.
00040              *
00041              * This function must be implemented by all derived classes. The 
00042              * function shall generate a serialized form of the variable.
00043              *
00044              * \return The serialized form of the variable.
00045              *
00046              * \exception None: The function shall not throw.
00047              */
00048             // Needed for encoding varbinds
00049             virtual data_t serialize() const = 0;
00050 
00051             /**
00052              * \brief Destructor.
00053              */
00054              virtual ~variable()
00055              {
00056              }
00057 
00058             /**
00059              * \internal
00060              *
00061              * \brief Update the internal state of the variable.
00062              *
00063              * This function must be implemented in derived classes. It shall 
00064              * update the internal state of the object.
00065              *
00066              * \exception generic_error If obtaining the new value failed. The
00067              *                          state of such an object cannot be 
00068              *                          updated.
00069              */
00070             virtual void update()=0;
00071     };
00072 }
00073 
00074 
00075 #endif