Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

ServerTime_impl.cpp

Go to the documentation of this file.
00001 
00005 /* --------------------------------------------------------------
00006 Copyright (C) 2001 LifeLine Networks BV <soap2corba@lifeline.nl>
00007 
00008 This program is free software; you can redistribute it and/or
00009 modify it under the terms of the GNU General Public License
00010 as published by the Free Software Foundation; either
00011 version 2 of the License, or (at your option) any later
00012 version.
00013 
00014 This program is distributed in the hope that it will be useful,
00015 but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017 GNU General Public License for more details.
00018 
00019 You should have received a copy of the GNU General Public License
00020 along with this program; if not, write to the Free Software
00021 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00022 -------------------------------------------------------------- */
00023 #include <OB/CORBA.h>
00024 #include <OB/CosNaming.h>
00025 #include <ServerTime_impl.h>
00026 
00027 extern CORBA::ORB_ptr orb;
00028 
00029 //
00030 // IDL:ServerTime:1.0
00031 //
00032 
00033 //
00034 // IDL:ServerTime/Time:1.0
00035 //
00036 ServerTime::Time_impl::Time_impl()
00037     : m_drift (0)
00038 {
00039 }
00040 
00041 ServerTime::Time_impl::~Time_impl()
00042 {
00043 }
00044 
00045 //
00046 // IDL:ServerTime/Time/Now:1.0
00047 //
00048 CORBA::Long
00049 ServerTime::Time_impl::Now()
00050     throw(CORBA::SystemException)
00051 {
00052     CORBA::Long _r = (CORBA::Long) (time (NULL) + m_drift);
00053     return _r;
00054 }
00055 
00056 //
00057 // IDL:ServerTime/Time/Drift:1.0
00058 //
00059 CORBA::Long
00060 ServerTime::Time_impl::Drift()
00061     throw(CORBA::SystemException)
00062 {
00063     CORBA::Long _r = (CORBA::Long) m_drift;
00064     return _r;
00065 }
00066 
00067 void
00068 ServerTime::Time_impl::Drift(CORBA::Long a)
00069     throw(CORBA::SystemException)
00070 {
00071     m_drift = (time_t) a;
00072 }
00073 
00074 //
00075 // IDL:ServerTime/Time/WaitThisLong:1.0
00076 //
00077 void
00078 ServerTime::Time_impl::WaitThisLong(CORBA::Long seconds)
00079     throw(CORBA::SystemException)
00080 {
00081     CORBA::Long s;
00082     for (s = 0; s < seconds; s ++) {
00083         JTCThread::sleep (1000);
00084     }
00085 }
00086 

This documentation is part of the "SOAP to CORBA bridge" project
Copyright © 2000 by Lifeline Networks bv.
All rights are reserved.