Apache Log4cxx  Version 1.8.0
propertysetter.h
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #ifndef _LOG4CXX_CONFIG_PROPERTYSETTER_H
19 #define _LOG4CXX_CONFIG_PROPERTYSETTER_H
20 
21 #include <log4cxx/logstring.h>
22 #include <log4cxx/helpers/object.h>
23 
24 namespace LOG4CXX_NS
25 {
26 namespace helpers
27 {
28 class Object;
30 }
31 }
32 
33 // Instantiate template pointer type passed as parameter
34 LOG4CXX_INSTANTIATE_EXPORTED_PTR(LOG4CXX_NS::helpers::Object);
35 
36 namespace LOG4CXX_NS
37 {
38 namespace helpers
39 {
40 class Properties;
41 class Pool;
42 }
43 
44 namespace config
45 {
62 class LOG4CXX_EXPORT PropertySetter
63 {
64  protected:
65  helpers::ObjectPtr obj;
66 
67  public:
74  PropertySetter(const helpers::ObjectPtr& obj);
75 
85  static void setProperties(const helpers::ObjectPtr& obj, helpers::Properties& properties, const LogString& prefix);
86 
91  void setProperties(helpers::Properties& properties, const LogString& prefix);
92 
101  void setProperty(const LogString& option, const LogString& value);
102 
103  void activate();
104 
105 #if LOG4CXX_ABI_VERSION <= 15
109  [[deprecated("Use setProperties() without a Pool parameter instead")]]
110  static void setProperties(const helpers::ObjectPtr& obj, helpers::Properties& properties, const LogString& prefix, helpers::Pool& p);
114  [[deprecated("Use setProperties() without a Pool parameter instead")]]
115  void setProperties(helpers::Properties& properties, const LogString& prefix, helpers::Pool& p);
119  [[deprecated("Use setProperty() without a Pool parameter instead")]]
120  void setProperty(const LogString& option, const LogString& value, helpers::Pool& p);
124  [[deprecated("Use activate() without a Pool parameter instead")]]
126 #endif
127 }; // class PropertySetter
128 } // namespace config;
129 } // namespace log4cxx
130 
131 #endif //_LOG4CXX_CONFIG_PROPERTYSETTER_H
General purpose Object property setter.
Definition: propertysetter.h:63
void setProperty(const LogString &option, const LogString &value, helpers::Pool &p)
static void setProperties(const helpers::ObjectPtr &obj, helpers::Properties &properties, const LogString &prefix)
Set the properties of an object passed as a parameter in one go.
static void setProperties(const helpers::ObjectPtr &obj, helpers::Properties &properties, const LogString &prefix, helpers::Pool &p)
PropertySetter(const helpers::ObjectPtr &obj)
Create a new PropertySetter for the specified Object.
void setProperties(helpers::Properties &properties, const LogString &prefix)
Set the properites for the object that match the prefix passed as parameter.
void setProperties(helpers::Properties &properties, const LogString &prefix, helpers::Pool &p)
helpers::ObjectPtr obj
Definition: propertysetter.h:65
void activate(helpers::Pool &p)
void setProperty(const LogString &option, const LogString &value)
Set a property on this PropertySetter's Object.
base class for java-like objects.
Definition: object.h:102
Definition: pool.h:33
Definition: properties.h:33
LOG4CXX_PTR_DEF(Object)
std::basic_string< logchar > LogString
Definition: logstring.h:60
LOG4CXX_INSTANTIATE_EXPORTED_PTR(log4cxx::helpers::Object)