xref: /aoo42x/main/autodoc/inc/ary/actions.hxx (revision 1c78a5d6)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef ARY_ACTIONS_HXX
25 #define ARY_ACTIONS_HXX
26 //  KORR_DEPRECATED_3.0
27 
28 
29 // USED SERVICES
30     // BASE CLASSES
31     // COMPONENTS
32     // PARAMETERS
33 
34 
35 namespace ary
36 {
37     class RepositoryCenter;
38 
39 
40 /*
41 enum E_Action
42 {
43     action_Parse,
44     action_SecondaryProductions,
45     action_Save,
46     action_Load,
47     action_ReadyForRead
48 };
49 */
50 
51 
52 /** @resp
53     Performs such commands on the repository, which refer to
54     large parts of it.
55 
56     @collab ::ary::Repository
57             and its components and derivates.
58     @descr
59     This class works in kind of double dispatch way:
60 
61     // Client code:
62     Command_Xy  aMyCommand;
63     ary::Repository::The_().PerformCommand( aMyCommand );
64 
65     // Repository_Implementation::PerformCommand() code:
66     aMyCommand.Run(*this);
67 
68     // Command_Xy::Run(Repository_Implementation & rRepository) code:
69     rRepository.Run_Command_Xy(*this);
70 */
71 class Command
72 {
73   public:
~Command()74     virtual             ~Command() {}
75 
76     void                Run(
77                             n22::RepositoryCenter &
78                                                 io_rReposy );
79   private:
80     virtual void        do_Run(
81                             n22::RepositoryCenter &
82                                                 io_rReposy ) = 0;
83 };
84 
85 
86 // IMPLEMENTATION
87 
88 inline void
Run(n22::RepositoryCenter & io_rReposy)89 Command::Run(n22::RepositoryCenter & io_rReposy)
90     { do_Run(io_rReposy); }
91 
92 
93 } // namespace ary
94 
95 
96 #endif
97 
98 
99 
100