2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 * @file ValidatorCommon.h
18 * @author Bartlomiej Grzelewski (b.grzelewski@samsung.com)
20 * @brief This file contais definictions of common types used in ValidationCore.
22 #ifndef _VALIDATORCOMMON_H_
23 #define _VALIDATORCOMMON_H_
29 namespace ValidationCore {
30 typedef std::set< std::string > ReferenceSet;
31 typedef std::list< std::string > ObjectList;
37 struct ValidatorCoreUniversalFree {};
39 // Template Specialization
40 #define VC_DECLARE_DELETER(type, function) \
42 struct ValidatorCoreUniversalFree <type> { \
43 void universal_free(type *ptr){ \
58 AutoPtr(const AutoPtr<T> &second)
60 m_data = second.m_data;
64 AutoPtr & operator=(const AutoPtr &second)
66 if (this != &second) {
67 ValidatorCoreUniversalFree<T> deleter;
68 deleter.universal_free(m_data);
69 m_data = second.m_data;
76 * overloaded -> operator, so smart ptr could act as ordinary ptr
85 ValidatorCoreUniversalFree<T> deleter;
86 deleter.universal_free(m_data);
90 * get internal pointer
100 } // namespace ValidationCore
102 #endif // _VALIDATORCOMMON_H_