OpenCores
URL https://opencores.org/ocsvn/w11/w11/trunk

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.61/] [tools/] [src/] [librw11/] [Rw11UnitVirt.ipp] - Blame information for rev 19

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 19 wfjm
// $Id: Rw11UnitVirt.ipp 504 2013-04-13 15:37:24Z mueller $
2
//
3
// Copyright 2013- by Walter F.J. Mueller 
4
//
5
// This program is free software; you may redistribute and/or modify it under
6
// the terms of the GNU General Public License as published by the Free
7
// Software Foundation, either version 2, or at your option any later version.
8
//
9
// This program is distributed in the hope that it will be useful, but
10
// WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
11
// or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12
// for complete details.
13
//
14
// Revision History:
15
// Date         Rev Version  Comment
16
// 2013-03-03   494   1.0    Initial version
17
// 2013-02-05   483   0.1    First draft
18
// ---------------------------------------------------------------------------
19
 
20
/*!
21
  \file
22
  \version $Id: Rw11UnitVirt.ipp 504 2013-04-13 15:37:24Z mueller $
23
  \brief   Implemenation (inline) of Rw11UnitVirt.
24
*/
25
 
26
#include "boost/thread/locks.hpp"
27
 
28
#include "librtools/RosFill.hpp"
29
 
30
#include "Rw11UnitVirt.hpp"
31
 
32
/*!
33
  \class Retro::Rw11UnitVirt
34
  \brief FIXME_docs
35
*/
36
 
37
// all method definitions in namespace Retro
38
namespace Retro {
39
 
40
//------------------------------------------+-----------------------------------
41
//! Default constructor
42
 
43
template 
44
Rw11UnitVirt::Rw11UnitVirt(Rw11Cntl* pcntl, size_t index)
45
  : Rw11Unit(pcntl, index),
46
    fpVirt()
47
{}
48
 
49
//------------------------------------------+-----------------------------------
50
//! Destructor
51
 
52
template 
53
Rw11UnitVirt::~Rw11UnitVirt()
54
{}
55
 
56
//------------------------------------------+-----------------------------------
57
//! FIXME_docs
58
 
59
template 
60
inline TV* Rw11UnitVirt::Virt() const
61
{
62
  return fpVirt.get();
63
}
64
 
65
//------------------------------------------+-----------------------------------
66
//! FIXME_docs
67
 
68
template 
69
inline bool Rw11UnitVirt::Attach(const std::string& url, RerrMsg& emsg)
70
{
71
  // synchronize with server thread
72
  boost::lock_guard lock(Connect());
73
  if (fpVirt) DetachCleanup();
74
  fpVirt.reset(TV::New(url, this, emsg));
75
  if (fpVirt) AttachSetup();
76
  return fpVirt;
77
}
78
 
79
//------------------------------------------+-----------------------------------
80
//! FIXME_docs
81
 
82
template 
83
inline void Rw11UnitVirt::Detach()
84
{
85
  // synchronize with server thread
86
  boost::lock_guard lock(Connect());
87
  if (fpVirt) DetachCleanup();
88
  fpVirt.reset();
89
  return;
90
}
91
 
92
//------------------------------------------+-----------------------------------
93
//! FIXME_docs
94
 
95
template 
96
void Rw11UnitVirt::Dump(std::ostream& os, int ind,
97
                               const char* text) const
98
{
99
  RosFill bl(ind);
100
  os << bl << (text?text:"--") << "Rw11UnitVirt @ " << this << std::endl;
101
  if (fpVirt) {
102
    fpVirt->Dump(os, ind+2, "*fpVirt: ");
103
  } else {
104
    os << bl << "  fpVirt:          " << fpVirt.get()   << std::endl;
105
  }
106
 
107
  Rw11Unit::Dump(os, ind, " ^");
108
  return;
109
}
110
 
111
} // end namespace Retro

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.