Revision
15784
Author
mrene
Date
2009-12-03 23:15:41 -0600 (Thu, 03 Dec 2009)

Log Message

update object support header file

Modified Paths

Diff

Modified: freeswitch/trunk/contrib/mrene/cpp/object_support.h (15783 => 15784)


--- freeswitch/trunk/contrib/mrene/cpp/object_support.h	2009-12-04 01:45:14 UTC (rev 15783)
+++ freeswitch/trunk/contrib/mrene/cpp/object_support.h	2009-12-04 05:15:41 UTC (rev 15784)
@@ -40,7 +40,8 @@
 	
 	void unlock()
 	{
-		switch_mutex_unlock(m_mutex);	}
+		switch_mutex_unlock(m_mutex);
+	}
 	
 	class scoped_lock 
 	{
@@ -153,6 +154,17 @@
 		}
 	}
 	
+	MemoryPool(switch_core_session_t *session)
+	{
+		if (session) {
+			m_owned = false;
+			m_pool = switch_core_session_get_pool(session);
+		} else {
+			m_owned = true;
+			switch_core_new_memory_pool(&m_pool);
+		}
+	}
+	
 	MemoryPool()
 	{
 		switch_core_new_memory_pool(&m_pool);
@@ -180,6 +192,19 @@
 	{
 		return switch_core_strdup(m_pool, s);
 	}
+	
+	char *sprintf(const char *fmt, ...)
+	{
+		va_list ap;
+		char *result = NULL;
+
+		va_start(ap, fmt);
+		result = switch_core_vsprintf(m_pool, fmt, ap);
+		va_end(ap);
+		
+		return result;
+	}
 };
 
+
 #endif /* OBJECT_SUPPORT_H */
\ No newline at end of file