X64 transport [Part 5] (Update plugins.cpp)
[xy_vsfilter.git] / src / log4cplus / src / logloguser.cxx
blob1f1acb37821467319afa2659f5710f2de96c476d
1 // Module: Log4CPLUS
2 // File: logloguser.cxx
3 // Created: 6/2003
4 // Author: Tad E. Smith
5 //
6 //
7 // Copyright 2003-2009 Tad E. Smith
8 //
9 // Licensed under the Apache License, Version 2.0 (the "License");
10 // you may not use this file except in compliance with the License.
11 // You may obtain a copy of the License at
13 // http://www.apache.org/licenses/LICENSE-2.0
15 // Unless required by applicable law or agreed to in writing, software
16 // distributed under the License is distributed on an "AS IS" BASIS,
17 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 // See the License for the specific language governing permissions and
19 // limitations under the License.
21 #include <log4cplus/streams.h>
22 #include <log4cplus/helpers/logloguser.h>
23 #include <log4cplus/helpers/loglog.h>
25 using namespace std;
26 using namespace log4cplus;
27 using namespace log4cplus::helpers;
29 typedef SharedObjectPtr<LogLog> LogLogPtr;
33 ///////////////////////////////////////////////////////////////////////////////
34 // log4cplus::helpers::LogLogUser ctor and dtor
35 ///////////////////////////////////////////////////////////////////////////////
37 LogLogUser::LogLogUser()
39 loglogRef = new SharedObjectPtr<LogLog>(LogLog::getLogLog());
43 LogLogUser::LogLogUser(const LogLogUser& rhs)
45 loglogRef = new SharedObjectPtr<LogLog>(*static_cast<LogLogPtr*>(rhs.loglogRef));
49 LogLogUser::~LogLogUser()
51 delete static_cast<LogLogPtr*>(loglogRef);
56 ///////////////////////////////////////////////////////////////////////////////
57 // log4cplus::helpers::LogLogUser public methods
58 ///////////////////////////////////////////////////////////////////////////////
60 LogLog&
61 LogLogUser::getLogLog() const
63 LogLogPtr* ptr = static_cast<LogLogPtr*>(loglogRef);
64 return **ptr;
68 LogLogUser&
69 LogLogUser::operator=(const LogLogUser& rhs)
71 if(this == &rhs) {
72 return *this;
75 delete static_cast<LogLogPtr*>(loglogRef);
76 loglogRef = new SharedObjectPtr<LogLog>(*static_cast<LogLogPtr*>(rhs.loglogRef));
78 return *this;