Action_Thermostats
        Add_AtomRandomPerturbation
        Add_RotateAroundBondAction
        Add_SelectAtomByNameAction
        Adding_Graph_to_ChangeBondActions
        Adding_MD_integration_tests
        Adding_StructOpt_integration_tests
        AutomationFragmentation_failures
        Candidate_v1.6.0
        Candidate_v1.6.1
        Candidate_v1.7.0
        ChangeBugEmailaddress
        ChangingTestPorts
        ChemicalSpaceEvaluator
        Disabling_MemDebug
        Docu_Python_wait
        EmpiricalPotential_contain_HomologyGraph_documentation
        Enhance_userguide
        Enhanced_StructuralOptimization
        Enhanced_StructuralOptimization_continued
        Example_ManyWaysToTranslateAtom
        Exclude_Hydrogens_annealWithBondGraph
        FitPartialCharges_GlobalError
        Fix_ChronosMutex
        Fix_StatusMsg
        Fix_StepWorldTime_single_argument
        Fix_Verbose_Codepatterns
        ForceAnnealing_goodresults
        ForceAnnealing_oldresults
        ForceAnnealing_tocheck
        ForceAnnealing_with_BondGraph
        ForceAnnealing_with_BondGraph_continued
        ForceAnnealing_with_BondGraph_continued_betteresults
        ForceAnnealing_with_BondGraph_contraction-expansion
        GeometryObjects
        Gui_displays_atomic_force_velocity
        IndependentFragmentGrids_IntegrationTest
        JobMarket_RobustOnKillsSegFaults
        JobMarket_StableWorkerPool
        PartialCharges_OrthogonalSummation
        PythonUI_with_named_parameters
        QtGui_reactivate_TimeChanged_changes
        Recreated_GuiChecks
        RotateToPrincipalAxisSystem_UndoRedo
        StoppableMakroAction
        TremoloParser_IncreasedPrecision
        TremoloParser_MultipleTimesteps
        Ubuntu_1604_changes
        stable
      
      
      
| Rev | Line |  | 
|---|
| [084729c] | 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.