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

Subversion Repositories w11

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

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

Line No. Rev Author Line
1 21 wfjm
// $Id: Rw11UnitVirt.ipp 515 2013-05-04 17:28:59Z mueller $
2 19 wfjm
//
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 21 wfjm
// 2013-05-03   515   1.1    use AttachDone(),DetachCleanup(),DetachDone()
17 19 wfjm
// 2013-03-03   494   1.0    Initial version
18
// 2013-02-05   483   0.1    First draft
19
// ---------------------------------------------------------------------------
20
 
21
/*!
22
  \file
23 21 wfjm
  \version $Id: Rw11UnitVirt.ipp 515 2013-05-04 17:28:59Z mueller $
24 19 wfjm
  \brief   Implemenation (inline) of Rw11UnitVirt.
25
*/
26
 
27
#include "boost/thread/locks.hpp"
28
 
29
#include "librtools/RosFill.hpp"
30
 
31
#include "Rw11UnitVirt.hpp"
32
 
33
/*!
34
  \class Retro::Rw11UnitVirt
35
  \brief FIXME_docs
36
*/
37
 
38
// all method definitions in namespace Retro
39
namespace Retro {
40
 
41
//------------------------------------------+-----------------------------------
42
//! Default constructor
43
 
44
template 
45
Rw11UnitVirt::Rw11UnitVirt(Rw11Cntl* pcntl, size_t index)
46
  : Rw11Unit(pcntl, index),
47
    fpVirt()
48
{}
49
 
50
//------------------------------------------+-----------------------------------
51
//! Destructor
52
 
53
template 
54
Rw11UnitVirt::~Rw11UnitVirt()
55
{}
56
 
57
//------------------------------------------+-----------------------------------
58
//! FIXME_docs
59
 
60
template 
61
inline TV* Rw11UnitVirt::Virt() const
62
{
63
  return fpVirt.get();
64
}
65
 
66
//------------------------------------------+-----------------------------------
67
//! FIXME_docs
68
 
69
template 
70
inline bool Rw11UnitVirt::Attach(const std::string& url, RerrMsg& emsg)
71
{
72
  // synchronize with server thread
73
  boost::lock_guard lock(Connect());
74 21 wfjm
  if (fpVirt) Detach();
75 19 wfjm
  fpVirt.reset(TV::New(url, this, emsg));
76 21 wfjm
  if (fpVirt) AttachDone();
77 19 wfjm
  return fpVirt;
78
}
79
 
80
//------------------------------------------+-----------------------------------
81
//! FIXME_docs
82
 
83
template 
84
inline void Rw11UnitVirt::Detach()
85
{
86
  // synchronize with server thread
87
  boost::lock_guard lock(Connect());
88 21 wfjm
  if (!fpVirt) return;
89
  DetachCleanup();
90 19 wfjm
  fpVirt.reset();
91 21 wfjm
  DetachDone();
92 19 wfjm
  return;
93
}
94
 
95
//------------------------------------------+-----------------------------------
96
//! FIXME_docs
97
 
98
template 
99
void Rw11UnitVirt::Dump(std::ostream& os, int ind,
100
                               const char* text) const
101
{
102
  RosFill bl(ind);
103
  os << bl << (text?text:"--") << "Rw11UnitVirt @ " << this << std::endl;
104
  if (fpVirt) {
105
    fpVirt->Dump(os, ind+2, "*fpVirt: ");
106
  } else {
107
    os << bl << "  fpVirt:          " << fpVirt.get()   << std::endl;
108
  }
109
 
110
  Rw11Unit::Dump(os, ind, " ^");
111
  return;
112
}
113
 
114
} // end namespace Retro

powered by: WebSVN 2.1.0

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