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 model_bind_to_dao.h
18 * @author Grzegorz Krawczyk (g.krawczyk@samsung.com)
23 #ifndef DPL_MODEL_BIND_TO_DAO_H_
24 #define DPL_MODEL_BIND_TO_DAO_H_
29 * @param ObjectType type of object used as delegate argument
30 * @param RetType Type returned from the external function
31 * @param ExtArg Type of argument required by external fun
32 * @param getterFun Object Type method which returns value of type ExtArg
33 * used as argument for external function
40 ExtArg(ObjectType::*argGetter) () const,
41 ValueType(*externalGetter) (ExtArg)
43 struct BindToDAO_Static
45 static ValueType Get(DPL::Event::Model* obj)
47 ObjectType* instance = static_cast<ObjectType*>(obj);
49 return externalGetter((instance->*argGetter)());
58 ExtArg(ObjectType::*argGetter) () const,
59 ValueType(ExtObject::*externalGetter) () const
63 static ValueType Get(DPL::Event::Model* obj)
65 ObjectType* instance = static_cast<ObjectType*>(obj);
66 ExtObject extObject((instance->*argGetter)());
67 return (extObject.*externalGetter)();