UniSet  2.6.0
UProxyObject.h
00001 /*
00002  * Copyright (c) 2015 Pavel Vainerman.
00003  *
00004  * This program is free software: you can redistribute it and/or modify
00005  * it under the terms of the GNU Lesser General Public License as
00006  * published by the Free Software Foundation, version 2.1.
00007  *
00008  * This program is distributed in the hope that it will be useful, but
00009  * WITHOUT ANY WARRANTY; without even the implied warranty of
00010  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00011  * Lesser General Lesser Public License for more details.
00012  *
00013  * You should have received a copy of the GNU Lesser General Public License
00014  * along with this program. If not, see <http://www.gnu.org/licenses/>.
00015  */
00016 // -------------------------------------------------------------------------
00017 #ifndef UProxyObject_H_
00018 #define UProxyObject_H_
00019 // --------------------------------------------------------------------------
00020 #include <memory>
00021 #include "Configuration.h"
00022 #include "UExceptions.h"
00023 #include "UTypes.h"
00024 // --------------------------------------------------------------------------
00025 class UProxyObject_impl; // PIMPL
00026 // --------------------------------------------------------------------------
00041 class UProxyObject
00042 {
00043     public:
00044         UProxyObject( const std::string& name ) throw(UException);
00045         UProxyObject( long id ) throw(UException);
00046         ~UProxyObject();
00047 
00049         void addToAsk( long id ) throw(UException);
00050 
00051         long getValue( long id ) throw(UException);
00052         float getFloatValue( long id ) throw(UException);
00053 
00055         void setValue( long id, long val ) throw(UException);
00056 
00058         bool askIsOK();
00059 
00061         bool reaskSensors();
00062 
00066         bool updateValues();
00067 
00069         bool smIsOK();
00070 
00071     protected:
00072         void init( long id ) throw( UException );
00073 
00074     private:
00075         UProxyObject()throw(UException);
00076 
00077         std::shared_ptr<UProxyObject_impl> uobj;
00078 };
00079 //---------------------------------------------------------------------------
00080 #endif
00081 //---------------------------------------------------------------------------