Adding_StructOpt_integration_tests
        AutomationFragmentation_failures
        Candidate_v1.6.1
        Candidate_v1.7.0
        ChemicalSpaceEvaluator
        Enhanced_StructuralOptimization
        Enhanced_StructuralOptimization_continued
        Exclude_Hydrogens_annealWithBondGraph
        ForceAnnealing_with_BondGraph
        ForceAnnealing_with_BondGraph_contraction-expansion
        Gui_displays_atomic_force_velocity
        JobMarket_RobustOnKillsSegFaults
        JobMarket_StableWorkerPool
        PythonUI_with_named_parameters
        StoppableMakroAction
        TremoloParser_IncreasedPrecision
        stable
      
      
        
          | 
            Last change
 on this file since 53a85a was             9eb71b3, checked in by Frederik Heber <frederik.heber@…>, 9 years ago           | 
        
        
          | 
             
Commented out MemDebug include and Memory::ignore. 
 
- MemDebug clashes with various allocation operators that use a specific
placement in memory. It is so far not possible to wrap new/delete fully.
Hence, we stop this effort which so far has forced us to put ever more
includes (with clashes) into MemDebug and thereby bloat compilation time.
 - MemDebug does not add that much usefulness which is not also provided by
valgrind.
  
           | 
        
        
          
            
              - 
Property                 mode
 set to                 
100644
               
             
           | 
        
        
          | 
            File size:
            1.6 KB
           | 
        
      
      
| Line |   | 
|---|
| 1 | /*
 | 
|---|
| 2 |  * Project: MoleCuilder
 | 
|---|
| 3 |  * Description: creates and alters molecular systems
 | 
|---|
| 4 |  * Copyright (C)  2010 University of Bonn. All rights reserved.
 | 
|---|
| 5 |  * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
 | 
|---|
| 6 |  */
 | 
|---|
| 7 | 
 | 
|---|
| 8 | /*
 | 
|---|
| 9 |  * Observer.cpp
 | 
|---|
| 10 |  *
 | 
|---|
| 11 |  *  Created on: Jan 19, 2010
 | 
|---|
| 12 |  *      Author: crueger
 | 
|---|
| 13 |  */
 | 
|---|
| 14 | 
 | 
|---|
| 15 | // include config.h
 | 
|---|
| 16 | #ifdef HAVE_CONFIG_H
 | 
|---|
| 17 | #include <config.h>
 | 
|---|
| 18 | #endif
 | 
|---|
| 19 | 
 | 
|---|
| 20 | //#include "CodePatterns/MemDebug.hpp"
 | 
|---|
| 21 | 
 | 
|---|
| 22 | #include "CodePatterns/Observer/Observer.hpp"
 | 
|---|
| 23 | 
 | 
|---|
| 24 | #include <iostream>
 | 
|---|
| 25 | 
 | 
|---|
| 26 | #include "CodePatterns/Assert.hpp"
 | 
|---|
| 27 | #ifdef LOG_OBSERVER
 | 
|---|
| 28 | #include "CodePatterns/Observer/ObserverLog.hpp"
 | 
|---|
| 29 | #endif
 | 
|---|
| 30 | 
 | 
|---|
| 31 | 
 | 
|---|
| 32 | /** Constructor for class Observer.
 | 
|---|
| 33 |  */
 | 
|---|
| 34 | Observer::Observer(std::string name)
 | 
|---|
| 35 | {
 | 
|---|
| 36 | #ifdef LOG_OBSERVER
 | 
|---|
| 37 |   observerLog().addName(this,name);
 | 
|---|
| 38 |   observerLog().addMessage() << "++ Creating Observer " << observerLog().getName(this);
 | 
|---|
| 39 | #endif
 | 
|---|
| 40 | }
 | 
|---|
| 41 | 
 | 
|---|
| 42 | /**
 | 
|---|
| 43 |  * Base Constructor for class Observer
 | 
|---|
| 44 |  *
 | 
|---|
| 45 |  * only called from Observable Constructor
 | 
|---|
| 46 |  */
 | 
|---|
| 47 | Observer::Observer(Observer::BaseConstructor){
 | 
|---|
| 48 | #ifdef LOG_OBSERVER
 | 
|---|
| 49 |   observerLog().addObservable(this);
 | 
|---|
| 50 | #endif
 | 
|---|
| 51 | }
 | 
|---|
| 52 | 
 | 
|---|
| 53 | /** Destructor for class Observer.
 | 
|---|
| 54 |  */
 | 
|---|
| 55 | Observer::~Observer()
 | 
|---|
| 56 | {
 | 
|---|
| 57 | #ifdef LOG_OBSERVER
 | 
|---|
| 58 |   if(!observerLog().isObservable(this)){
 | 
|---|
| 59 |     observerLog().addMessage() << "-- Destroying Observer " << observerLog().getName(this);
 | 
|---|
| 60 |   }
 | 
|---|
| 61 | #endif
 | 
|---|
| 62 | }
 | 
|---|
| 63 | 
 | 
|---|
| 64 | /**
 | 
|---|
| 65 |  * Method for specialized notifications.
 | 
|---|
| 66 |  * Most Observers wont need or use this, so it is implemented
 | 
|---|
| 67 |  * empty in the base case;
 | 
|---|
| 68 |  */
 | 
|---|
| 69 | void Observer::recieveNotification(Observable *publisher, Notification_ptr notification){
 | 
|---|
| 70 |   ASSERT(0,"Notification received by object that did not sign on for it or did you not implement this function?");
 | 
|---|
| 71 | }
 | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.