string attributes



What should the typical get/set methods look like for a string type
attribute? 

Take this as an example:

-----------------------------
idl:
interface Foo {
	attribute string bar;
}
-----------------------------
C:
static CORBA_string
impl_Foo__get_bar(impl_POA_DataMine * servant,
                             CORBA_Environment * ev)
{
   return servant->attr_bar;
}
                                                                                
static void
impl_Foo__set_bar(impl_POA_DataMine * servant,
                             const CORBA_char * value, CORBA_Environment
* ev)
{
    servant->attr_bar = value;
}
--------------------------

Is this all there is to it? What happens when the set method is called
multiple times? Does it free the old string for you?

Thanks,
-- 
\ Craig Patrick McDaniel
/_\ Software Engineer
/_/_\ n + 1, Inc.
/_/_/_\ http://www.nplus1.net
/_/_/_/_\ (502) 479-5557





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]