1 /******************************************************************************
2 * Copyright (c) 2000-2016 Ericsson Telecom AB
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
12 ******************************************************************************/
17 #ifdef TITAN_RUNTIME_2
19 /** This class contains the functions needed for adding and removing referenced
20 * indexes to record of/set of types and the optional type (only in RT2).
21 * By default the functions are empty.*/
22 class RefdIndexInterface
25 virtual ~RefdIndexInterface() {}
26 virtual void add_refd_index(int) {}
27 virtual void remove_refd_index(int) {}
30 /** References to record of/set of elements through 'out' and 'inout' function
31 * parameters are handled by this class.
32 * Usage: create instances of this class before the function call (one instance
33 * for each referenced index), and place the instances and the function call in
34 * a block (so the destructor is called immediately after the function call).
35 * This way the referenced indexes are cleaned up even if the function call ends
36 * with an exception (DTE) */
37 class RefdIndexHandler
40 RefdIndexHandler(RefdIndexInterface* p_container, int p_index)
42 container = p_container;
44 container->add_refd_index(index);
49 container->remove_refd_index(index);
53 RefdIndexInterface* container;
57 #endif /* TITAN_RUNTIME_2 */
59 #endif /* REFDINDEX_HH */