celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bpe...@apache.org
Subject [3/9] celix git commit: CELIX-236: change name format to camelCase
Date Wed, 27 Jan 2016 14:34:28 GMT
CELIX-236: change name format to camelCase


Project: http://git-wip-us.apache.org/repos/asf/celix/repo
Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/6a56692b
Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/6a56692b
Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/6a56692b

Branch: refs/heads/develop
Commit: 6a56692b7870881a9ed490ab7340f39fbb57e032
Parents: 4feeabc
Author: Bjoern Petri <bpetri@apache.org>
Authored: Thu Jan 14 10:45:00 2016 +0100
Committer: Bjoern Petri <bpetri@apache.org>
Committed: Thu Jan 14 10:45:00 2016 +0100

----------------------------------------------------------------------
 .../celix/bootstrap/argument_parser.py          |   2 +-
 .../bootstrap/templates/bundle/CMakeLists.txt   |  14 +-
 .../templates/bundle/bundle_activator.c         | 158 +++++++++----------
 .../bootstrap/templates/bundle/component.c      |  66 ++++----
 .../bootstrap/templates/bundle/component.h      |  14 +-
 5 files changed, 133 insertions(+), 121 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/6a56692b/celix-bootstrap/celix/bootstrap/argument_parser.py
----------------------------------------------------------------------
diff --git a/celix-bootstrap/celix/bootstrap/argument_parser.py b/celix-bootstrap/celix/bootstrap/argument_parser.py
index 922d98c..ad477f9 100644
--- a/celix-bootstrap/celix/bootstrap/argument_parser.py
+++ b/celix-bootstrap/celix/bootstrap/argument_parser.py
@@ -12,7 +12,7 @@ def main() :
 	UPDATE_COMMAND = "update"
 
 	#positional
-	parser.add_argument("command", help="The command to executee", choices=(CREATE_PROJECT_COMMAND,
CREATE_BUNDLE_COMMAND, CREATE_SERVICE_COMMAND, UPDATE_COMMAND))
+	parser.add_argument("command", help="The command to execute", choices=(CREATE_PROJECT_COMMAND,
CREATE_BUNDLE_COMMAND, UPDATE_COMMAND))
 	parser.add_argument("directory", help="The directory to work on")
 
 	#optional

http://git-wip-us.apache.org/repos/asf/celix/blob/6a56692b/celix-bootstrap/celix/bootstrap/templates/bundle/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/celix-bootstrap/celix/bootstrap/templates/bundle/CMakeLists.txt b/celix-bootstrap/celix/bootstrap/templates/bundle/CMakeLists.txt
index 98c45f5..a6295b2 100644
--- a/celix-bootstrap/celix/bootstrap/templates/bundle/CMakeLists.txt
+++ b/celix-bootstrap/celix/bootstrap/templates/bundle/CMakeLists.txt
@@ -1,11 +1,15 @@
 #{{
-#import yaml
+#import os, yaml
 #bundle = None 
 #with open(bundleFile) as input :
 #	bundle = yaml.load(input)
 #
 #if not 'components' in bundle or bundle['components'] is None:
 # 	bundle['components'] = []
+#else:
+#	for comp in bundle['components'] : 
+#		if not 'serviceDependencies' in comp or comp['serviceDependencies'] is None:
+#			comp['serviceDependencies'] = []
 #
 #}}
 #{{end}}
@@ -34,6 +38,14 @@ SET(BUNDLE_VERSION "0.0.1")
 include_directories(
 	"private/include"
 	"public/include"
+#{{ 
+#for comp in bundle['components'] : 
+#	for service in comp['serviceDependencies']:
+#			cog.outl("\t\"%s\"" % os.path.dirname(service['include'])) 
+#}}
+"org.example.mybundle" #do not edit, generated code
+#{{end}}
+
 )
 
 bundle(

http://git-wip-us.apache.org/repos/asf/celix/blob/6a56692b/celix-bootstrap/celix/bootstrap/templates/bundle/bundle_activator.c
----------------------------------------------------------------------
diff --git a/celix-bootstrap/celix/bootstrap/templates/bundle/bundle_activator.c b/celix-bootstrap/celix/bootstrap/templates/bundle/bundle_activator.c
index a62b1f0..d28b73c 100644
--- a/celix-bootstrap/celix/bootstrap/templates/bundle/bundle_activator.c
+++ b/celix-bootstrap/celix/bootstrap/templates/bundle/bundle_activator.c
@@ -1,7 +1,7 @@
 //TODO update fields from <service>Type to <service>For<component>Type
-//TODO improve names to camel case (e.g. from _add_logger_for_example to _addLoggerToExample)
+
 //{{
-//import yaml
+//import os, yaml
 //bundle = None 
 //with open(bundleFile) as input :
 //	bundle = yaml.load(input)
@@ -32,7 +32,7 @@
 //	for service in comp['providedServices'] :
 //		cog.outl("#include <%s>" % service['include'])
 //	for service in comp['serviceDependencies'] :
-//		cog.outl("#include <%s>" % service['include'])
+//		cog.outl("#include <%s>" % os.path.split(service['include'])[1])
 //}}
 //{{end}}
 
@@ -41,18 +41,18 @@
 //Private (static) function declarations
 //{{
 //for comp in bundle['components'] :
-//	cog.outl("static bundleActivator_resolveState_for_%s(struct activator *activator);" %
comp['name'])
+//	cog.outl("static bundleActivator_resolveStateFor%s(struct activator *activator);" % comp['name'].title())
 //	for service in comp['serviceDependencies'] :
-//		cog.outl("static celix_status_t bundleActivator_add_%s_for_%s(void *handle, service_reference_pt
ref, void *service);" % (service['name'], comp['name']))
-//		cog.outl("static celix_status_t bundleActivator_remove_%s_for_%s(void *handle, service_reference_pt
ref, void *service);" % (service['name'], comp['name']))
+//		cog.outl("static celix_status_t bundleActivator_add%sFor%s(void *handle, service_reference_pt
ref, void *service);" % (service['name'].title(), comp['name'].title()))
+//		cog.outl("static celix_status_t bundleActivator_remove%sFor%s(void *handle, service_reference_pt
ref, void *service);" % (service['name'].title(), comp['name'].title()))
 //}}
-static bundleActivator_resolveState_for_example(struct activator *activator); //do not edit,
generated code
-static celix_status_t bundleActivator_add_logger_for_example(void *handle, service_reference_pt
ref, void *service); //do not edit, generated code
-static celix_status_t bundleActivator_remove_logger_for_example(void *handle, service_reference_pt
ref, void *service); //do not edit, generated code
-static celix_status_t bundleActivator_add_loggerOptional_for_example(void *handle, service_reference_pt
ref, void *service); //do not edit, generated code
-static celix_status_t bundleActivator_remove_loggerOptional_for_example(void *handle, service_reference_pt
ref, void *service); //do not edit, generated code
-static celix_status_t bundleActivator_add_loggerMany_for_example(void *handle, service_reference_pt
ref, void *service); //do not edit, generated code
-static celix_status_t bundleActivator_remove_loggerMany_for_example(void *handle, service_reference_pt
ref, void *service); //do not edit, generated code
+static bundleActivator_resolveStateForExample(struct activator *activator); //do not edit,
generated code
+static celix_status_t bundleActivator_addLoggerForExample(void *handle, service_reference_pt
ref, void *service); //do not edit, generated code
+static celix_status_t bundleActivator_removeLoggerForExample(void *handle, service_reference_pt
ref, void *service); //do not edit, generated code
+static celix_status_t bundleActivator_addLoggerOptionalForExample(void *handle, service_reference_pt
ref, void *service); //do not edit, generated code
+static celix_status_t bundleActivator_removeLoggerOptionalForExample(void *handle, service_reference_pt
ref, void *service); //do not edit, generated code
+static celix_status_t bundleActivator_addLoggerManyForExample(void *handle, service_reference_pt
ref, void *service); //do not edit, generated code
+static celix_status_t bundleActivator_removeLoggerManyForExample(void *handle, service_reference_pt
ref, void *service); //do not edit, generated code
 //{{end}}
 static celix_status_t bundleActivator_getFirst(hash_map_pt services, void **result);
 
@@ -77,8 +77,8 @@ struct activator {
 //		cog.outl("\tservice_tracker_customizer_pt %sCustomizer;" % service['name'])
 //		cog.outl("\tservice_tracker_pt %sServiceTracker;" % service['name'])
 //		if service['cardinality'] == "one" or service['cardinality'] == "optional" :
-//			cog.outl("\thash_map_pt %s_services_for_%s;" % (service['name'], comp['name']))
-//			cog.outl("\t%s current_%s_service_for_%s;" % (service['type'], service['name'], comp['name']))

+//			cog.outl("\thash_map_pt %sServicesFor%s;" % (service['name'], comp['name'].title()))
+//			cog.outl("\t%s current%sServiceFor%s;" % (service['type'], service['name'].title(),
comp['name'].title())) 
 //	for service in comp['providedServices'] :
 //		cog.outl("\t%s %s;" % (service['type'], service['name']))
 //		cog.outl("\tservice_registration_pt %sServiceRegistry;" % service['name'])
@@ -90,12 +90,12 @@ struct activator {
 	component_state_type exampleState; //do not edit, generated code
 	service_tracker_customizer_pt loggerCustomizer; //do not edit, generated code
 	service_tracker_pt loggerServiceTracker; //do not edit, generated code
-	hash_map_pt logger_services_for_example; //do not edit, generated code
-	log_service_pt current_logger_service_for_example; //do not edit, generated code
+	hash_map_pt loggerServicesForExample; //do not edit, generated code
+	log_service_pt currentLoggerServiceForExample; //do not edit, generated code
 	service_tracker_customizer_pt loggerOptionalCustomizer; //do not edit, generated code
 	service_tracker_pt loggerOptionalServiceTracker; //do not edit, generated code
-	hash_map_pt loggerOptional_services_for_example; //do not edit, generated code
-	log_service_pt current_loggerOptional_service_for_example; //do not edit, generated code
+	hash_map_pt loggerOptionalServicesForExample; //do not edit, generated code
+	log_service_pt currentLoggerOptionalServiceForExample; //do not edit, generated code
 	service_tracker_customizer_pt loggerManyCustomizer; //do not edit, generated code
 	service_tracker_pt loggerManyServiceTracker; //do not edit, generated code
 	command_service_pt command; //do not edit, generated code
@@ -121,14 +121,14 @@ celix_status_t bundleActivator_create(bundle_context_pt context, void
**userData
 //
 //	for service in comp['serviceDependencies'] :
 //		cog.outl("\t\tactivator->%sServiceTracker = NULL;" % service['name'])
-//		cog.outl("\t\tserviceTrackerCustomizer_create(activator, NULL, bundleActivator_add_%s_for_%s,
NULL, bundleActivator_remove_%s_for_%s, &activator->%sCustomizer);" % (service['name'],
comp['name'], service['name'], comp['name'], service['name']))
+//		cog.outl("\t\tserviceTrackerCustomizer_create(activator, NULL, bundleActivator_add%sFor%s,
NULL, bundleActivator_remove%sFor%s, &activator->%sCustomizer);" % (service['name'].title(),
comp['name'].title(), service['name'].title(), comp['name'].title(), service['name']))
 //		if 'service_name' in service :
 //			cog.outl("\t\tserviceTracker_create(context, (char *) %s, activator->%sCustomizer,
&activator->%sServiceTracker);" % (service['service_name'], service['name'], service['name']))
 //		else :
 //			cog.outl("\t\tserviceTracker_createWithService(context, \"%s\", activator->%sCustomizer,
&activator->%sServiceTracker);" % (service['filter'], service['name'], service['name']))
 //		if service['cardinality'] == "one" or service['cardinality'] == "optional" :
-//			cog.outl("\t\tactivator->%s_services_for_%s = hashMap_create(NULL, NULL, NULL, NULL);"
% (service['name'], comp['name']))
-//			cog.outl("\t\tactivator->current_%s_service_for_%s = NULL;" % (service['name'], comp['name']))
+//			cog.outl("\t\tactivator->%sServicesFor%s = hashMap_create(NULL, NULL, NULL, NULL);"
% (service['name'], comp['name'].title()))
+//			cog.outl("\t\tactivator->current%sServiceFor%s = NULL;" % (service['name'].title(),
comp['name'].title()))
 //
 //	for service in comp['providedServices'] :
 //		cog.outl("\t\tactivator->%s = NULL;" % service['name'])
@@ -141,17 +141,17 @@ celix_status_t bundleActivator_create(bundle_context_pt context, void
**userData
 		activator->exampleState = COMPONENT_STATE_CREATED; //do not edit, generated code
 		pthread_mutex_init(&activator->exampleLock, NULL); //do not edit, generated code
 		activator->loggerServiceTracker = NULL; //do not edit, generated code
-		serviceTrackerCustomizer_create(activator, NULL, bundleActivator_add_logger_for_example,
NULL, bundleActivator_remove_logger_for_example, &activator->loggerCustomizer); //do
not edit, generated code
+		serviceTrackerCustomizer_create(activator, NULL, bundleActivator_addLoggerForExample, NULL,
bundleActivator_removeLoggerForExample, &activator->loggerCustomizer); //do not edit,
generated code
 		serviceTracker_create(context, (char *) OSGI_LOGSERVICE_NAME, activator->loggerCustomizer,
&activator->loggerServiceTracker); //do not edit, generated code
-		activator->logger_services_for_example = hashMap_create(NULL, NULL, NULL, NULL); //do
not edit, generated code
-		activator->current_logger_service_for_example = NULL; //do not edit, generated code
+		activator->loggerServicesForExample = hashMap_create(NULL, NULL, NULL, NULL); //do not
edit, generated code
+		activator->currentLoggerServiceForExample = NULL; //do not edit, generated code
 		activator->loggerOptionalServiceTracker = NULL; //do not edit, generated code
-		serviceTrackerCustomizer_create(activator, NULL, bundleActivator_add_loggerOptional_for_example,
NULL, bundleActivator_remove_loggerOptional_for_example, &activator->loggerOptionalCustomizer);
//do not edit, generated code
+		serviceTrackerCustomizer_create(activator, NULL, bundleActivator_addLoggerOptionalForExample,
NULL, bundleActivator_removeLoggerOptionalForExample, &activator->loggerOptionalCustomizer);
//do not edit, generated code
 		serviceTracker_create(context, (char *) OSGI_LOGSERVICE_NAME, activator->loggerOptionalCustomizer,
&activator->loggerOptionalServiceTracker); //do not edit, generated code
-		activator->loggerOptional_services_for_example = hashMap_create(NULL, NULL, NULL, NULL);
//do not edit, generated code
-		activator->current_loggerOptional_service_for_example = NULL; //do not edit, generated
code
+		activator->loggerOptionalServicesForExample = hashMap_create(NULL, NULL, NULL, NULL);
//do not edit, generated code
+		activator->currentLoggerOptionalServiceForExample = NULL; //do not edit, generated code
 		activator->loggerManyServiceTracker = NULL; //do not edit, generated code
-		serviceTrackerCustomizer_create(activator, NULL, bundleActivator_add_loggerMany_for_example,
NULL, bundleActivator_remove_loggerMany_for_example, &activator->loggerManyCustomizer);
//do not edit, generated code
+		serviceTrackerCustomizer_create(activator, NULL, bundleActivator_addLoggerManyForExample,
NULL, bundleActivator_removeLoggerManyForExample, &activator->loggerManyCustomizer);
//do not edit, generated code
 		serviceTracker_create(context, (char *) OSGI_LOGSERVICE_NAME, activator->loggerManyCustomizer,
&activator->loggerManyServiceTracker); //do not edit, generated code
 		activator->command = NULL; //do not edit, generated code
 		activator->commandServiceRegistry = NULL; //do not edit, generated code
@@ -316,11 +316,11 @@ static celix_status_t bundleActivator_getFirst(hash_map_pt services,
void **resu
 //ResolveNewState
 //{{
 //for comp in bundle['components'] :
-//	cog.outl("static bundleActivator_resolveState_for_%s(struct activator *activator) {" %
comp['name'])
+//	cog.outl("static bundleActivator_resolveStateFor%s(struct activator *activator) {" % comp['name'].title())
 //	cog.outl("\tcelix_status_t status = CELIX_SUCCESS;")
 //
 //	cog.out("\tif (activator->%sState == COMPONENT_STATE_CREATED " % comp['name'])
-//	conditions = [("activator->current_%s_service_for_%s != NULL" % (serv['name'], comp['name']))
for serv in comp['serviceDependencies'] if serv['cardinality'] == "one"] 
+//	conditions = [("activator->current%sServiceFor%s != NULL" % (serv['name'].title(),
comp['name'].title())) for serv in comp['serviceDependencies'] if serv['cardinality'] == "one"]

 //	if len(conditions) > 0: 
 //		cog.out(" && ")
 //		cog.out(" && ".join(conditions))
@@ -329,7 +329,7 @@ static celix_status_t bundleActivator_getFirst(hash_map_pt services, void
**resu
 //	cog.outl("\t}")
 //
 //	cog.out("\tif (activator->%sState == COMPONENT_STATE_STARTED " % comp['name'])
-//	conditions = [("activator->current_%s_service_for_%s == NULL" % (serv['name'], comp['name']))
for serv in comp['serviceDependencies'] if serv['cardinality'] == "one"]
+//	conditions = [("activator->current%sServiceFor%s == NULL" % (serv['name'].title(),
comp['name'].title())) for serv in comp['serviceDependencies'] if serv['cardinality'] == "one"]
 //	if len(conditions) > 0:
 //		cog.out(" && (");
 //		cog.out(" || ".join(conditions))
@@ -341,42 +341,42 @@ static celix_status_t bundleActivator_getFirst(hash_map_pt services,
void **resu
 //	cog.outl("\treturn status;")
 //	cog.outl("}")
 //}}
-static bundleActivator_resolveState_for_example(struct activator *activator) { //do not edit,
generated code
+static bundleActivator_resolveStateForExample(struct activator *activator) { //do not edit,
generated code
 	celix_status_t status = CELIX_SUCCESS; //do not edit, generated code
-	if (activator->exampleState == COMPONENT_STATE_CREATED && activator->current_logger_service_for_example
!= NULL) { //do not edit, generated code
+	if (activator->exampleState == COMPONENT_STATE_CREATED && activator->currentLoggerServiceForExample
!= NULL) { //do not edit, generated code
 		example_start(activator->example); //do not edit, generated code
 	} //do not edit, generated code
-	if (activator->exampleState == COMPONENT_STATE_STARTED && (activator->current_logger_service_for_example
== NULL)) { //do not edit, generated code
+	if (activator->exampleState == COMPONENT_STATE_STARTED && (activator->currentLoggerServiceForExample
== NULL)) { //do not edit, generated code
 		example_stop(activator->example); //do not edit, generated code
 	} //do not edit, generated code
 	return status; //do not edit, generated code
 } //do not edit, generated code
 //{{end}}
 
-//Add/Remove functions for the trakkers
+//Add/Remove functions for the trackers
 //{{
 //for comp in bundle['components'] :
 //	for service in comp['serviceDependencies'] :
-//		cog.outl("static celix_status_t bundleActivator_add_%s_for_%s(void *handle, service_reference_pt
ref, void *service) {" % (service['name'], comp['name']))
+//		cog.outl("static celix_status_t bundleActivator_add%sFor%s(void *handle, service_reference_pt
ref, void *service) {" % (service['name'].title(), comp['name'].title()))
 //		cog.outl("\tcelix_status_t status = CELIX_SUCCESS;")
 //		cog.outl("\tstruct activator *activator = handle;")
 //		cog.outl("\t%s %s = service;" % (service['type'], service['name']))
 //		if service['cardinality'] == "many" :
-//			cog.outl("\t%s_add_%s(activator->%s, %s);" % (comp['name'], service['name'], comp['name'],
service['name']))
+//			cog.outl("\t%s_add%s(activator->%s, %s);" % (comp['name'], service['name'].title(),
comp['name'], service['name']))
 //		else :
 //			cog.outl("\tpthread_mutex_lock(&activator->%sLock);" % comp['name']);
 //			cog.outl("\t%s highest = NULL;" % service['type']);
-//			cog.outl("\tbundleActivator_getFirst(activator->%s_services_for_%s, (void **)&highest);"
% (service['name'], comp['name']))
-//			cog.outl("\tif (highest != activator->current_%s_service_for_%s) {" % (service['name'],
comp['name']))
-//			cog.outl("\t\tactivator->current_%s_service_for_%s = highest;" % (service['name'],
comp['name']))
-//			cog.outl("\t\t%s_set_%s(activator->%s, highest);" % (comp['name'], service['name'],
comp['name'])) 
-//			cog.outl("\t\tbundleActivator_resolveState_for_%s(activator);" % comp['name']);
+//			cog.outl("\tbundleActivator_getFirst(activator->%sServicesFor%s, (void **)&highest);"
% (service['name'], comp['name'].title()))
+//			cog.outl("\tif (highest != activator->current%sServiceFor%s) {" % (service['name'].title(),
comp['name'].title()))
+//			cog.outl("\t\tactivator->current%sServiceFor%s = highest;" % (service['name'].title(),
comp['name'].title()))
+//			cog.outl("\t\t%s_set%s(activator->%s, highest);" % (comp['name'], service['name'].title(),
comp['name'])) 
+//			cog.outl("\t\tbundleActivator_resolveStateFor%s(activator);" % comp['name'].title());
 //			cog.outl("\t}")
 //			cog.outl("\tpthread_mutex_unlock(&activator->%sLock);" % comp['name']);
 //		cog.outl("\treturn status;")
 //		cog.outl("}")
 //		cog.outl("")
-//		cog.outl("static celix_status_t bundleActivator_remove_%s_for_%s(void *handle, service_reference_pt
ref, void *service) {" % (service['name'], comp['name']))
+//		cog.outl("static celix_status_t bundleActivator_remove%sFor%s(void *handle, service_reference_pt
ref, void *service) {" % (service['name'].title(), comp['name'].title()))
 //		cog.outl("\tcelix_status_t status = CELIX_SUCCESS;")
 //		cog.outl("\tstruct activator *activator = handle;")
 //		cog.outl("\t%s %s = service;" % (service['type'], service['name']))
@@ -385,94 +385,94 @@ static bundleActivator_resolveState_for_example(struct activator *activator)
{ /
 //			cog.outl("\t%s_remove_%s(activator->%s, %s);" % (comp['name'], service['name'], comp['name'],
service['name']))
 //		else :
 //			cog.outl("\tpthread_mutex_lock(&activator->%sLock);" % comp['name']);
-//			cog.outl("\thashMap_remove(activator->%s_services_for_%s, ref);" % (service['name'],
comp['name']))
-//			cog.outl("\tif (activator->current_%s_service_for_%s == service) { " % (service['name'],
comp['name']))
+//			cog.outl("\thashMap_remove(activator->%sServicesFor%s, ref);" % (service['name'],
comp['name'].title()))
+//			cog.outl("\tif (activator->current%sServiceFor%s == service) { " % (service['name'].title(),
comp['name'].title()))
 //			cog.outl("\t\t%s highest = NULL;" % service['type']);
-//		cog.outl("\t\tbundleActivator_getFirst(activator->%s_services_for_%s, (void **)&highest);"
% (service['name'], comp['name']))
-//		cog.outl("\t\tactivator->current_%s_service_for_%s = highest;" % (service['name'],
comp['name']))
-//		cog.outl("\t\tbundleActivator_resolveState_for_%s(activator);" % comp['name']);
-//		cog.outl("\t\t%s_set_%s(activator->%s, highest);" % (comp['name'], service['name'],
comp['name'])) 
+//		cog.outl("\t\tbundleActivator_getFirst(activator->%sServicesFor%s, (void **)&highest);"
% (service['name'], comp['name'].title()))
+//		cog.outl("\t\tactivator->current%sServiceFor%s = highest;" % (service['name'].title(),
comp['name'].title()))
+//		cog.outl("\t\tbundleActivator_resolveStateFor%s(activator);" % comp['name'].title());
+//		cog.outl("\t\t%s_set%s(activator->%s, highest);" % (comp['name'], service['name'].title(),
comp['name'])) 
 //		cog.outl("\t}")
 //		cog.outl("\tpthread_mutex_unlock(&activator->%sLock);" % comp['name']);
 //		cog.outl("\treturn status;")
 //		cog.outl("}")
 //		cog.outl("")
 //}}
-static celix_status_t bundleActivator_add_logger_for_example(void *handle, service_reference_pt
ref, void *service) { //do not edit, generated code
+static celix_status_t bundleActivator_addLoggerForExample(void *handle, service_reference_pt
ref, void *service) { //do not edit, generated code
 	celix_status_t status = CELIX_SUCCESS; //do not edit, generated code
 	struct activator *activator = handle; //do not edit, generated code
 	log_service_pt logger = service; //do not edit, generated code
 	pthread_mutex_lock(&activator->exampleLock); //do not edit, generated code
 	log_service_pt highest = NULL; //do not edit, generated code
-	bundleActivator_getFirst(activator->logger_services_for_example, (void **)&highest);
//do not edit, generated code
-	if (highest != activator->current_logger_service_for_example) { //do not edit, generated
code
-		activator->current_logger_service_for_example = highest; //do not edit, generated code
-		example_set_logger(activator->example, highest); //do not edit, generated code
-		bundleActivator_resolveState_for_example(activator); //do not edit, generated code
+	bundleActivator_getFirst(activator->loggerServicesForExample, (void **)&highest);
//do not edit, generated code
+	if (highest != activator->currentLoggerServiceForExample) { //do not edit, generated
code
+		activator->currentLoggerServiceForExample = highest; //do not edit, generated code
+		example_setLogger(activator->example, highest); //do not edit, generated code
+		bundleActivator_resolveStateForExample(activator); //do not edit, generated code
 	} //do not edit, generated code
 	pthread_mutex_unlock(&activator->exampleLock); //do not edit, generated code
 	return status; //do not edit, generated code
 } //do not edit, generated code
 
-static celix_status_t bundleActivator_remove_logger_for_example(void *handle, service_reference_pt
ref, void *service) { //do not edit, generated code
+static celix_status_t bundleActivator_removeLoggerForExample(void *handle, service_reference_pt
ref, void *service) { //do not edit, generated code
 	celix_status_t status = CELIX_SUCCESS; //do not edit, generated code
 	struct activator *activator = handle; //do not edit, generated code
 	log_service_pt logger = service; //do not edit, generated code
 	pthread_mutex_lock(&activator->exampleLock); //do not edit, generated code
-	hashMap_remove(activator->logger_services_for_example, ref); //do not edit, generated
code
-	if (activator->current_logger_service_for_example == service) {  //do not edit, generated
code
+	hashMap_remove(activator->loggerServicesForExample, ref); //do not edit, generated code
+	if (activator->currentLoggerServiceForExample == service) {  //do not edit, generated
code
 		log_service_pt highest = NULL; //do not edit, generated code
-		bundleActivator_getFirst(activator->logger_services_for_example, (void **)&highest);
//do not edit, generated code
-		activator->current_logger_service_for_example = highest; //do not edit, generated code
-		bundleActivator_resolveState_for_example(activator); //do not edit, generated code
-		example_set_logger(activator->example, highest); //do not edit, generated code
+		bundleActivator_getFirst(activator->loggerServicesForExample, (void **)&highest);
//do not edit, generated code
+		activator->currentLoggerServiceForExample = highest; //do not edit, generated code
+		bundleActivator_resolveStateForExample(activator); //do not edit, generated code
+		example_setLogger(activator->example, highest); //do not edit, generated code
 	} //do not edit, generated code
 	pthread_mutex_unlock(&activator->exampleLock); //do not edit, generated code
 	return status; //do not edit, generated code
 } //do not edit, generated code
 
-static celix_status_t bundleActivator_add_loggerOptional_for_example(void *handle, service_reference_pt
ref, void *service) { //do not edit, generated code
+static celix_status_t bundleActivator_addLoggerOptionalForExample(void *handle, service_reference_pt
ref, void *service) { //do not edit, generated code
 	celix_status_t status = CELIX_SUCCESS; //do not edit, generated code
 	struct activator *activator = handle; //do not edit, generated code
 	log_service_pt loggerOptional = service; //do not edit, generated code
 	pthread_mutex_lock(&activator->exampleLock); //do not edit, generated code
 	log_service_pt highest = NULL; //do not edit, generated code
-	bundleActivator_getFirst(activator->loggerOptional_services_for_example, (void **)&highest);
//do not edit, generated code
-	if (highest != activator->current_loggerOptional_service_for_example) { //do not edit,
generated code
-		activator->current_loggerOptional_service_for_example = highest; //do not edit, generated
code
-		example_set_loggerOptional(activator->example, highest); //do not edit, generated code
-		bundleActivator_resolveState_for_example(activator); //do not edit, generated code
+	bundleActivator_getFirst(activator->loggerOptionalServicesForExample, (void **)&highest);
//do not edit, generated code
+	if (highest != activator->currentLoggerOptionalServiceForExample) { //do not edit, generated
code
+		activator->currentLoggerOptionalServiceForExample = highest; //do not edit, generated
code
+		example_setLoggerOptional(activator->example, highest); //do not edit, generated code
+		bundleActivator_resolveStateForExample(activator); //do not edit, generated code
 	} //do not edit, generated code
 	pthread_mutex_unlock(&activator->exampleLock); //do not edit, generated code
 	return status; //do not edit, generated code
 } //do not edit, generated code
 
-static celix_status_t bundleActivator_remove_loggerOptional_for_example(void *handle, service_reference_pt
ref, void *service) { //do not edit, generated code
+static celix_status_t bundleActivator_removeLoggerOptionalForExample(void *handle, service_reference_pt
ref, void *service) { //do not edit, generated code
 	celix_status_t status = CELIX_SUCCESS; //do not edit, generated code
 	struct activator *activator = handle; //do not edit, generated code
 	log_service_pt loggerOptional = service; //do not edit, generated code
 	pthread_mutex_lock(&activator->exampleLock); //do not edit, generated code
-	hashMap_remove(activator->loggerOptional_services_for_example, ref); //do not edit, generated
code
-	if (activator->current_loggerOptional_service_for_example == service) {  //do not edit,
generated code
+	hashMap_remove(activator->loggerOptionalServicesForExample, ref); //do not edit, generated
code
+	if (activator->currentLoggerOptionalServiceForExample == service) {  //do not edit, generated
code
 		log_service_pt highest = NULL; //do not edit, generated code
-		bundleActivator_getFirst(activator->loggerOptional_services_for_example, (void **)&highest);
//do not edit, generated code
-		activator->current_loggerOptional_service_for_example = highest; //do not edit, generated
code
-		bundleActivator_resolveState_for_example(activator); //do not edit, generated code
-		example_set_loggerOptional(activator->example, highest); //do not edit, generated code
+		bundleActivator_getFirst(activator->loggerOptionalServicesForExample, (void **) &highest);
//do not edit, generated code
+		activator->currentLoggerOptionalServiceForExample = highest; //do not edit, generated
code
+		bundleActivator_resolveStateForExample(activator); //do not edit, generated code
+		example_setLoggerOptional(activator->example, highest); //do not edit, generated code
 	} //do not edit, generated code
 	pthread_mutex_unlock(&activator->exampleLock); //do not edit, generated code
 	return status; //do not edit, generated code
 } //do not edit, generated code
 
-static celix_status_t bundleActivator_add_loggerMany_for_example(void *handle, service_reference_pt
ref, void *service) { //do not edit, generated code
+static celix_status_t bundleActivator_addLoggerManyForExample(void *handle, service_reference_pt
ref, void *service) { //do not edit, generated code
 	celix_status_t status = CELIX_SUCCESS; //do not edit, generated code
 	struct activator *activator = handle; //do not edit, generated code
 	log_service_pt loggerMany = service; //do not edit, generated code
-	example_add_loggerMany(activator->example, loggerMany); //do not edit, generated code
+	example_addLoggerMany(activator->example, loggerMany); //do not edit, generated code
 	return status; //do not edit, generated code
 } //do not edit, generated code
 
-static celix_status_t bundleActivator_remove_loggerMany_for_example(void *handle, service_reference_pt
ref, void *service) { //do not edit, generated code
+static celix_status_t bundleActivator_removeLoggerManyForExample(void *handle, service_reference_pt
ref, void *service) { //do not edit, generated code
 	celix_status_t status = CELIX_SUCCESS; //do not edit, generated code
 	struct activator *activator = handle; //do not edit, generated code
 	log_service_pt loggerMany = service; //do not edit, generated code

http://git-wip-us.apache.org/repos/asf/celix/blob/6a56692b/celix-bootstrap/celix/bootstrap/templates/bundle/component.c
----------------------------------------------------------------------
diff --git a/celix-bootstrap/celix/bootstrap/templates/bundle/component.c b/celix-bootstrap/celix/bootstrap/templates/bundle/component.c
index 68b0a17..78ccdd2 100644
--- a/celix-bootstrap/celix/bootstrap/templates/bundle/component.c
+++ b/celix-bootstrap/celix/bootstrap/templates/bundle/component.c
@@ -34,20 +34,20 @@
 //for service in component['serviceDependencies'] : 
 //	if service['cardinality'] == "many" :
 //		cog.outl("\tarray_list_pt %sServices;" % (service['name']))	
-//		cog.outl("\tpthread_mutex_t mutex_for_%sServices;" % service['name']);
+//		cog.outl("\tpthread_mutex_t mutexFor%sServices;" % service['name'].title());
 //	else :
 //		cog.outl("\t%s %s;" % (service['type'], service['name']))	
-//		cog.outl("\tpthread_mutex_t mutex_for_%s;" % service['name']);
+//		cog.outl("\tpthread_mutex_t mutexFor%s;" % service['name'].title());
 //}}
 #include "example.h" //do not edit, generated code
 
 struct example { //do not edit, generated code
 	log_service_pt logger; //do not edit, generated code
-	pthread_mutex_t mutex_for_logger; //do not edit, generated code
+	pthread_mutex_t mutexForLogger; //do not edit, generated code
 	log_service_pt loggerOptional; //do not edit, generated code
-	pthread_mutex_t mutex_for_loggerOptional; //do not edit, generated code
+	pthread_mutex_t mutexForLoggerOptional; //do not edit, generated code
 	array_list_pt loggerManyServices; //do not edit, generated code
-	pthread_mutex_t mutex_for_loggerManyServices; //do not edit, generated code
+	pthread_mutex_t mutexForLoggerManyServices; //do not edit, generated code
 //{{end}}
 };
 
@@ -62,22 +62,22 @@ struct example { //do not edit, generated code
 //	if service['cardinality'] == "many" :
 //		cog.outl("\t\tcomponent->%sServices = NULL;" % service['name'])
 //		cog.outl("\t\tstatus = arrayList_create(&component->%sServices);" % service['name'])
-//		cog.outl("\t\tpthread_mutex_init(&component->mutex_for_%sServices, NULL);" % service['name'])
+//		cog.outl("\t\tpthread_mutex_init(&component->mutexFor%sServices, NULL);" % service['name'].title())
 //	else :
 //		cog.outl("\t\tcomponent->%s = NULL;" % service['name'])
-//		cog.outl("\t\tpthread_mutex_init(&component->mutex_for_%s, NULL);" % service['name'])
+//		cog.outl("\t\tpthread_mutex_init(&component->mutexFor%s, NULL);" % service['name'].title())
 //}}
 celix_status_t example_create(example_pt *result) { //do not edit, generated code
 	celix_status_t status = CELIX_SUCCESS; //do not edit, generated code
 	example_pt component = calloc(1, sizeof(*component)); //do not edit, generated code
 	if (component != NULL) { //do not edit, generated code
 		component->logger = NULL; //do not edit, generated code
-		pthread_mutex_init(&component->mutex_for_logger, NULL); //do not edit, generated
code
+		pthread_mutex_init(&component->mutexForLogger, NULL); //do not edit, generated code
 		component->loggerOptional = NULL; //do not edit, generated code
-		pthread_mutex_init(&component->mutex_for_loggerOptional, NULL); //do not edit, generated
code
+		pthread_mutex_init(&component->mutexForLoggerOptional, NULL); //do not edit, generated
code
 		component->loggerManyServices = NULL; //do not edit, generated code
 		status = arrayList_create(&component->loggerManyServices); //do not edit, generated
code
-		pthread_mutex_init(&component->mutex_for_loggerManyServices, NULL); //do not edit,
generated code
+		pthread_mutex_init(&component->mutexForLoggerManyServices, NULL); //do not edit,
generated code
 //{{end}}
 		(*result) = component;
 	} else {
@@ -128,62 +128,62 @@ celix_status_t example_stop(example_pt component) { //do not edit, generated
cod
 //{{
 //for service in component['serviceDependencies'] :
 //	if service['cardinality'] == "many" :
-//		cog.outl("celix_status_t %s_add_%s(%s_pt component, %s %s) {" % (componentName, service['name'],
componentName, service['type'], service['name'])) 
+//		cog.outl("celix_status_t %s_add%s(%s_pt component, %s %s) {" % (componentName, service['name'].title(),
componentName, service['type'], service['name'])) 
 //		cog.outl("\tcelix_status_t status = CELIX_SUCCESS;")
-//		cog.outl("printf(\" %s_add_%s called.\\n\");" % (componentName, service['name']))
-//		cog.outl("\tpthread_mutex_lock(&component->mutex_for_%sServices);" % service['name'])
+//		cog.outl("printf(\" %s_add%s called.\\n\");" % (componentName, service['name'].title()))
+//		cog.outl("\tpthread_mutex_lock(&component->mutexFor%sServices);" % service['name'].title())
 //		cog.outl("\tarrayList_add(component->%sServices, %s);" % (service['name'], service['name']))
-//		cog.outl("\tpthread_mutex_unlock(&component->mutex_for_%sServices);" % service['name'])
+//		cog.outl("\tpthread_mutex_unlock(&component->mutexFor%sServices);" % service['name'].title())
 //		cog.outl("\treturn status;")
 //		cog.outl("}")
 //		cog.outl("")
-//		cog.outl("celix_status_t %s_remove_%s(%s_pt component, %s %s) {" % (componentName, service['name'],
componentName, service['type'], service['name'])) 
+//		cog.outl("celix_status_t %s_remove%s(%s_pt component, %s %s) {" % (componentName, service['name'].title(),
componentName, service['type'], service['name'])) 
 //		cog.outl("\tcelix_status_t status = CELIX_SUCCESS;")
-//		cog.outl("\tpthread_mutex_lock(&component->mutex_for_%sServices);" % service['name'])
+//		cog.outl("\tpthread_mutex_lock(&component->mutexFor%sServices);" % service['name'].title())
 //		cog.outl("\tarrayList_removeElement(component->%sServices, %s);" % (service['name'],
service['name']))
-//		cog.outl("\tpthread_mutex_unlock(&component->mutex_for_%sServices);" % service['name'])
+//		cog.outl("\tpthread_mutex_unlock(&component->mutexFor%sServices);" % service['name'].title())
 //		cog.outl("\treturn status;")
 //		cog.outl("}")
 //	else :
-//		cog.outl("celix_status_t %s_set_%s(%s_pt component, %s %s) {" % (componentName, service['name'],
componentName, service['type'], service['name'])) 
+//		cog.outl("celix_status_t %s_set%s(%s_pt component, %s %s) {" % (componentName, service['name'].title(),
componentName, service['type'], service['name'])) 
 //		cog.outl("\tcelix_status_t status = CELIX_SUCCESS;")
-//		cog.outl("printf(\" %s_set_%s called.\\n\");" % (componentName, service['name']))
-//		cog.outl("\tpthread_mutex_lock(&component->mutex_for_%s);" % service['name'])
+//		cog.outl("printf(\" %s_set%s called.\\n\");" % (componentName, service['name'].title()))
+//		cog.outl("\tpthread_mutex_lock(&component->mutexFor%s);" % service['name'].title())
 //		cog.outl("\tcomponent->%s == %s;" % (service['name'], service['name']))
-//		cog.outl("\tpthread_mutex_unlock(&component->mutex_for_%s);" % service['name'])
+//		cog.outl("\tpthread_mutex_unlock(&component->mutexFor%s);" % service['name'].title())
 //		cog.outl("\treturn status;")
 //		cog.outl("}")
 //		cog.outl("")	
 //}}
-celix_status_t example_set_logger(example_pt component, log_service_pt logger) { //do not
edit, generated code
+celix_status_t example_setLogger(example_pt component, log_service_pt logger) { //do not
edit, generated code
 	celix_status_t status = CELIX_SUCCESS; //do not edit, generated code
-	pthread_mutex_lock(&component->mutex_for_logger); //do not edit, generated code
+	pthread_mutex_lock(&component->mutexFor:ogger); //do not edit, generated code
 	component->logger == logger; //do not edit, generated code
-	pthread_mutex_unlock(&component->mutex_for_logger); //do not edit, generated code
+	pthread_mutex_unlock(&component->mutexForLogger); //do not edit, generated code
 	return status; //do not edit, generated code
 } //do not edit, generated code
 
-celix_status_t example_set_loggerOptional(example_pt component, log_service_pt loggerOptional)
{ //do not edit, generated code
+celix_status_t example_setLoggerOptional(example_pt component, log_service_pt loggerOptional)
{ //do not edit, generated code
 	celix_status_t status = CELIX_SUCCESS; //do not edit, generated code
-	pthread_mutex_lock(&component->mutex_for_loggerOptional); //do not edit, generated
code
+	pthread_mutex_lock(&component->mutexForLoggerOptional); //do not edit, generated
code
 	component->loggerOptional == loggerOptional; //do not edit, generated code
-	pthread_mutex_unlock(&component->mutex_for_loggerOptional); //do not edit, generated
code
+	pthread_mutex_unlock(&component->mutexForLoggerOptional); //do not edit, generated
code
 	return status; //do not edit, generated code
 } //do not edit, generated code
 
-celix_status_t example_add_loggerMany(example_pt component, log_service_pt loggerMany) {
//do not edit, generated code
+celix_status_t example_addLoggerMany(example_pt component, log_service_pt loggerMany) { //do
not edit, generated code
 	celix_status_t status = CELIX_SUCCESS; //do not edit, generated code
-	pthread_mutex_lock(&component->mutex_for_loggerManyServices); //do not edit, generated
code
+	pthread_mutex_lock(&component->mutexFor:oggerManyServices); //do not edit, generated
code
 	arrayList_add(component->loggerManyServices, loggerMany); //do not edit, generated code
-	pthread_mutex_unlock(&component->mutex_for_loggerManyServices); //do not edit, generated
code
+	pthread_mutex_unlock(&component->mutexForLoggerManyServices); //do not edit, generated
code
 	return status; //do not edit, generated code
 } //do not edit, generated code
 
-celix_status_t example_remove_loggerMany(example_pt component, log_service_pt loggerMany)
{ //do not edit, generated code
+celix_status_t example_removeLoggerMany(example_pt component, log_service_pt loggerMany)
{ //do not edit, generated code
 	celix_status_t status = CELIX_SUCCESS; //do not edit, generated code
-	pthread_mutex_lock(&component->mutex_for_loggerManyServices); //do not edit, generated
code
+	pthread_mutex_lock(&component->mutexForLoggerManyServices); //do not edit, generated
code
 	arrayList_removeElement(component->loggerManyServices, loggerMany); //do not edit, generated
code
-	pthread_mutex_unlock(&component->mutex_for_loggerManyServices); //do not edit, generated
code
+	pthread_mutex_unlock(&component->mutexForLoggerManyServices); //do not edit, generated
code
 	return status; //do not edit, generated code
 } //do not edit, generated code
 

http://git-wip-us.apache.org/repos/asf/celix/blob/6a56692b/celix-bootstrap/celix/bootstrap/templates/bundle/component.h
----------------------------------------------------------------------
diff --git a/celix-bootstrap/celix/bootstrap/templates/bundle/component.h b/celix-bootstrap/celix/bootstrap/templates/bundle/component.h
index e036bbd..64972fd 100644
--- a/celix-bootstrap/celix/bootstrap/templates/bundle/component.h
+++ b/celix-bootstrap/celix/bootstrap/templates/bundle/component.h
@@ -62,15 +62,15 @@ celix_status_t example_destroy(example_pt component); //do not edit, generated
c
 //{{
 //for service in component['serviceDependencies'] :
 //	if service['cardinality'] == "many" :
-//		cog.outl("celix_status_t %s_add_%s(%s_pt component, %s %s);" % (componentName, service['name'],
componentName, service['type'], service['name']))
-//		cog.outl("celix_status_t %s_remove_%s(%s_pt component, %s %s);" % (componentName, service['name'],
componentName, service['type'], service['name']))
+//		cog.outl("celix_status_t %s_add%s(%s_pt component, %s %s);" % (componentName, service['name'].title(),
componentName, service['type'], service['name']))
+//		cog.outl("celix_status_t %s_remove%s(%s_pt component, %s %s);" % (componentName, service['name'].title(),
componentName, service['type'], service['name']))
 //	else :
-//		cog.outl("celix_status_t %s_set_%s(%s_pt component, %s %s);" % (componentName, service['name'],
componentName, service['type'], service['name']))
+//		cog.outl("celix_status_t %s_set%s(%s_pt component, %s %s);" % (componentName, service['name'].title(),
componentName, service['type'], service['name']))
 //}}
-celix_status_t example_set_logger(example_pt component, log_service_pt logger); //do not
edit, generated code
-celix_status_t example_set_loggerOptional(example_pt component, log_service_pt loggerOptional);
//do not edit, generated code
-celix_status_t example_add_loggerMany(example_pt component, log_service_pt loggerMany); //do
not edit, generated code
-celix_status_t example_remove_loggerMany(example_pt component, log_service_pt loggerMany);
//do not edit, generated code
+celix_status_t example_setLogger(example_pt component, log_service_pt logger); //do not edit,
generated code
+celix_status_t example_setLoggerOptional(example_pt component, log_service_pt loggerOptional);
//do not edit, generated code
+celix_status_t example_add:oggerMany(example_pt component, log_service_pt loggerMany); //do
not edit, generated code
+celix_status_t example_removeLoggerMany(example_pt component, log_service_pt loggerMany);
//do not edit, generated code
 //{{end}}
 
 //{{


Mime
View raw message