Modify the spec file for secure log
[framework/osp/social.git] / src / FSclRecord.cpp
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
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
7 //
8 //     http://www.apache.org/licenses/LICENSE-2.0
9 //
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.
15 //
16 /**
17  * @file                FSclRecord.cpp
18  * @brief               This is the implementation for Record class.
19  *
20  * This file contains definitions of @e Record class.
21  */
22
23 #include <FSclRecord.h>
24 #include <FBaseSysLog.h>
25 #include "FScl_RecordImpl.h"
26
27 namespace Tizen { namespace Social
28 {
29
30 Record::Record(RecordType type)
31 {
32         __pRecordImpl = new (std::nothrow) _RecordImpl(type);
33         SysTryReturnVoidResult(NID_SCL, __pRecordImpl != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
34 }
35
36 Record::Record(const Record& rhs)
37 {
38         __pRecordImpl = new (std::nothrow) _RecordImpl(*rhs.__pRecordImpl);
39         SysTryReturnVoidResult(NID_SCL, __pRecordImpl != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
40 }
41
42 Record&
43 Record::operator =(const Record& rhs)
44 {
45         if (this == &rhs)
46         {
47                 return *this;
48         }
49
50         *__pRecordImpl = *rhs.__pRecordImpl;
51
52         return *this;
53 }
54
55 Record::~Record()
56 {
57         delete __pRecordImpl;
58 }
59
60 RecordType
61 Record::GetRecordType(void) const
62 {
63         return __pRecordImpl->GetRecordType();
64 }
65
66 RecordId
67 Record::GetRecordId(void) const
68 {
69         return __pRecordImpl->GetRecordId();
70 }
71
72 }}  // Tizen::Social