| Last change
 on this file since ba6aa5 was             454bc54, checked in by Frederik Heber <heber@…>, 10 years ago | 
        
          | 
Added new pattern ObservedValue, contrary to Cacheable.
 essentially updates immediately and caches a value for off-line use, safe-
guard with mutexes.
added unit test for ObservedValue.
factored threeNumbers stub out of CacheableUnitTest, also used the stub in
ObservedValueUnitTest.
we may now signOn() to Notification with a priority.
Cacheable can also update now via notification channels not just for global
updates.
Observable can now also instantiate the channels directly if given a list.
This was necessary as Cacheable or ObservedValue are instantiated in the
constructor, too, and if listening to channels, these must already be
present.
FIX: Channels::addChannels() used NDEBUG wrong way round.
ObservedValue::get() returns reference.
 | 
        
          | 
              
Property                 mode
 set to                 100644 | 
        
          | File size:
            691 bytes | 
      
      
| Rev | Line |  | 
|---|
| [454bc54] | 1 | /* | 
|---|
|  | 2 | * ObservedValueUnitTest.hpp | 
|---|
|  | 3 | * | 
|---|
|  | 4 | *  Created on: Jun 19, 2015 | 
|---|
|  | 5 | *      Author: heber | 
|---|
|  | 6 | */ | 
|---|
|  | 7 |  | 
|---|
|  | 8 | #ifndef OBSERVEDVALUEUNITTEST_HPP_ | 
|---|
|  | 9 | #define OBSERVEDVALUEUNITTEST_HPP_ | 
|---|
|  | 10 |  | 
|---|
|  | 11 | // include config.h | 
|---|
|  | 12 | #ifdef HAVE_CONFIG_H | 
|---|
|  | 13 | #include <config.h> | 
|---|
|  | 14 | #endif | 
|---|
|  | 15 |  | 
|---|
|  | 16 | #include <cppunit/extensions/HelperMacros.h> | 
|---|
|  | 17 |  | 
|---|
|  | 18 | // stub classes | 
|---|
|  | 19 | class ObservedValue_threeNumbers; | 
|---|
|  | 20 |  | 
|---|
|  | 21 | class ObservedValueTest :  public CppUnit::TestFixture | 
|---|
|  | 22 | { | 
|---|
|  | 23 | CPPUNIT_TEST_SUITE( ObservedValueTest ); | 
|---|
|  | 24 | CPPUNIT_TEST ( doesRecalcTest ); | 
|---|
|  | 25 | CPPUNIT_TEST_SUITE_END(); | 
|---|
|  | 26 |  | 
|---|
|  | 27 | public: | 
|---|
|  | 28 | void setUp(); | 
|---|
|  | 29 | void tearDown(); | 
|---|
|  | 30 |  | 
|---|
|  | 31 | void doesRecalcTest(); | 
|---|
|  | 32 | ObservedValue_threeNumbers *numbers; | 
|---|
|  | 33 | ObservedValue_threeNumbers *YChange_numbers; | 
|---|
|  | 34 | }; | 
|---|
|  | 35 |  | 
|---|
|  | 36 | #endif /* OBSERVEDVALUEUNITTEST_HPP_ */ | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.