samples/main-callback.cc
changeset 53 ae406f4957d5
parent 16 99e833adbb46
child 54 f860e6f94787
--- a/samples/main-callback.cc	Tue Sep 05 12:54:53 2006 +0200
+++ b/samples/main-callback.cc	Tue Sep 05 13:13:39 2006 +0200
@@ -6,16 +6,16 @@
 using namespace ns3;
 
 static double 
-cb_one (double a, double b)
+cbOne (double a, double b)
 {
-	std::cout << "invoke cb_one a=" << a << ", b=" << b << std::endl;
+	std::cout << "invoke cbOne a=" << a << ", b=" << b << std::endl;
 	return a;
 }
 
 class MyCb {
 public:
-	int cb_two (double a) {
-		std::cout << "invoke cb_two a=" << a << std::endl;
+	int cbTwo (double a) {
+		std::cout << "invoke cbTwo a=" << a << std::endl;
 		return -5;
 	}
 };
@@ -27,32 +27,32 @@
 	// first arg type: double
 	// second arg type: double
 	Callback<double, double, double> one;
-	// build callback instance which points to cb_one function
-	one = make_callback (&cb_one);
+	// build callback instance which points to cbOne function
+	one = makeCallback (&cbOne);
 	// this is not a null callback
-	assert (!one.is_null ());
-	// invoke cb_one function through callback instance
-	double ret_one;
-	ret_one = one (10.0, 20.0);
+	assert (!one.isNull ());
+	// invoke cbOne function through callback instance
+	double retOne;
+	retOne = one (10.0, 20.0);
 
 	// return type: int
 	// first arg type: double
 	Callback<int, double> two;
 	MyCb cb;
-	// build callback instance which points to MyCb::cb_two
-	two = make_callback (&MyCb::cb_two, &cb);
+	// build callback instance which points to MyCb::cbTwo
+	two = makeCallback (&MyCb::cbTwo, &cb);
 	// this is not a null callback
-	assert (!two.is_null ());
-	// invoke MyCb::cb_two through callback instance
-	int ret_two;
-	ret_two = two (10.0);	
+	assert (!two.isNull ());
+	// invoke MyCb::cbTwo through callback instance
+	int retTwo;
+	retTwo = two (10.0);	
 
-	two = make_null_callback<int, double> ();
+	two = makeNullCallback<int, double> ();
 	// invoking a null callback is just like
 	// invoking a null function pointer:
 	// it will crash.
-	//int ret_two_null = two (20.0);
-	assert (two.is_null ());
+	//int retTwoNull = two (20.0);
+	assert (two.isNull ());
 
 	return 0;
 }