Statistics
| Branch: | Revision:

root / src / sim / parsim / cnosynchronization.h @ e1750c09

History | View | Annotate | Download (1.95 KB)

1
//=========================================================================
2
//  CNOSYNCHRONIZATION.H - part of
3
//
4
//                  OMNeT++/OMNEST
5
//           Discrete System Simulation in C++
6
//
7
//  Author: Andras Varga, 2003
8
//          Dept. of Electrical and Computer Systems Engineering,
9
//          Monash University, Melbourne, Australia
10
//
11
//=========================================================================
12

    
13
/*--------------------------------------------------------------*
14
  Copyright (C) 2003-2008 Andras Varga
15
  Copyright (C) 2006-2008 OpenSim Ltd.
16

17
  This file is distributed WITHOUT ANY WARRANTY. See the file
18
  `license' for details on this and other legal matters.
19
*--------------------------------------------------------------*/
20

    
21
#ifndef __NOSYNCHRONIZATION_H__
22
#define __NOSYNCHRONIZATION_H__
23

    
24
#include "cparsimprotocolbase.h"
25

    
26
NAMESPACE_BEGIN
27

    
28
// forward declarations
29
class cCommBuffer;
30

    
31
/**
32
 * "Dummy" implementation -- just pass messages between partitions,
33
 * without any synchronization. Of course incausalities may occur
34
 * which terminate the simulation with error, so this class is
35
 * only useful as a base "template" for implementing "real" synchronization
36
 * protocols.
37
 *
38
 * @ingroup Parsim
39
 */
40
class SIM_API cNoSynchronization : public cParsimProtocolBase
41
{
42
  public:
43
    /**
44
     * Constructor.
45
     */
46
    cNoSynchronization();
47

    
48
    /**
49
     * Destructor.
50
     */
51
    virtual ~cNoSynchronization();
52

    
53
    /**
54
     * Called at the beginning of a simulation run.
55
     */
56
    virtual void startRun();
57

    
58
    /**
59
     * Called at the end of a simulation run.
60
     */
61
    virtual void endRun();
62

    
63
    /**
64
     * Scheduler function. It processes whatever comes from other partitions,
65
     * then returns msgQueue.peekFirst(). Performs no synchronization
66
     * with other partitions, so incausalities may occur which stop the
67
     * simulation with an error (see also class comment).
68
     */
69
    virtual cMessage *getNextEvent();
70
};
71

    
72
NAMESPACE_END
73

    
74

    
75
#endif
76