| Last change
 on this file since 959c82 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:
            657 bytes | 
      
      
| Rev | Line |  | 
|---|
| [a80f419] | 1 | /* | 
|---|
|  | 2 | * CacheableUnitTest.hpp | 
|---|
|  | 3 | * | 
|---|
|  | 4 | *  Created on: Feb 2, 2010 | 
|---|
|  | 5 | *      Author: crueger | 
|---|
|  | 6 | */ | 
|---|
|  | 7 |  | 
|---|
|  | 8 | #ifndef CACHEABLEUNITTEST_HPP_ | 
|---|
|  | 9 | #define CACHEABLEUNITTEST_HPP_ | 
|---|
|  | 10 |  | 
|---|
| [70672e3] | 11 | // include config.h | 
|---|
|  | 12 | #ifdef HAVE_CONFIG_H | 
|---|
|  | 13 | #include <config.h> | 
|---|
|  | 14 | #endif | 
|---|
|  | 15 |  | 
|---|
| [a80f419] | 16 | #include <cppunit/extensions/HelperMacros.h> | 
|---|
|  | 17 |  | 
|---|
|  | 18 |  | 
|---|
|  | 19 | // stub classes | 
|---|
| [454bc54] | 20 | class Cacheable_threeNumbers; | 
|---|
| [a80f419] | 21 |  | 
|---|
|  | 22 | class CacheableTest :  public CppUnit::TestFixture | 
|---|
|  | 23 | { | 
|---|
|  | 24 | CPPUNIT_TEST_SUITE( CacheableTest ); | 
|---|
|  | 25 | CPPUNIT_TEST ( doesRecalcTest ); | 
|---|
|  | 26 | CPPUNIT_TEST_SUITE_END(); | 
|---|
|  | 27 |  | 
|---|
|  | 28 | public: | 
|---|
|  | 29 | void setUp(); | 
|---|
|  | 30 | void tearDown(); | 
|---|
|  | 31 |  | 
|---|
|  | 32 | void doesRecalcTest(); | 
|---|
| [454bc54] | 33 | Cacheable_threeNumbers *numbers; | 
|---|
|  | 34 | Cacheable_threeNumbers *YChange_numbers; | 
|---|
| [a80f419] | 35 | }; | 
|---|
|  | 36 |  | 
|---|
|  | 37 | #endif /* CACHEABLEUNITTEST_HPP_ */ | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.