Package org.omg.DynamicAny

Examples of org.omg.DynamicAny.DynStruct


            case TCKind._tk_struct:

                logger_.debug("Any is a struct");

                final DynStruct _dynStruct = DynStructHelper.narrow(any);
                String _currentName;

                _dynStruct.rewind();

                do
                {
                    _currentName = _dynStruct.current_member_name();

                    if (logger_.isDebugEnabled())
                    {
                        logger_.debug(" => " + _currentName);
                    }

                    if (_currentName.equals(_strippedIdentifier))
                    {
                        // expensive operation
                        _cursor = _dynStruct.current_component();
                        break SWITCH_LABEL;
                    }
                } while (_dynStruct.next());

                throw new EvaluationException("struct has no member " + _strippedIdentifier);

            case TCKind._tk_union:
View Full Code Here


        DynAny d1;
        DynAny d2;
        DynAny copy;
        String str;
        String wstr;
        DynStruct s1;
        DynStruct s2;
        String cp;
        TypeCode type;
        TypeCode tc;
        TestStruct ts = new TestStruct();
        TestStruct pts;
View Full Code Here

            case TCKind._tk_struct:

                logger_.debug("Any is a struct");

                final DynStruct _dynStruct = DynStructHelper.narrow(any);
                String _currentName;

                _dynStruct.rewind();

                do
                {
                    _currentName = _dynStruct.current_member_name();

                    if (logger_.isDebugEnabled())
                    {
                        logger_.debug(" => " + _currentName);
                    }

                    if (_currentName.equals(_strippedIdentifier))
                    {
                        // expensive operation
                        _cursor = _dynStruct.current_component();
                        break SWITCH_LABEL;
                    }
                } while (_dynStruct.next());

                throw new EvaluationException("struct has no member " + _strippedIdentifier);

            case TCKind._tk_union:
View Full Code Here

    {
        if ("struct".equals (type))
        {
            try
            {
                DynStruct dynStruct = DynStructHelper.narrow
                    (factory.create_dyn_any(value));

                dynStruct.to_any();

            }
            catch (org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode e)
            {
                throw new INTERNAL();
View Full Code Here

            case TCKind._tk_struct:

                logger_.debug("Any is a struct");

                final DynStruct _dynStruct = DynStructHelper.narrow(any);
                String _currentName;

                _dynStruct.rewind();

                do
                {
                    _currentName = _dynStruct.current_member_name();

                    if (logger_.isDebugEnabled())
                    {
                        logger_.debug(" => " + _currentName);
                    }

                    if (_currentName.equals(_strippedIdentifier))
                    {
                        // expensive operation
                        _cursor = _dynStruct.current_component();
                        break SWITCH_LABEL;
                    }
                } while (_dynStruct.next());

                throw new EvaluationException("struct has no member " + _strippedIdentifier);

            case TCKind._tk_union:
View Full Code Here

                    DynEnum dynEnum = (DynEnum)factory.create_dyn_any(a);
                    System.out.println("[Server]: ** Enum **");
                    System.out.println( dynEnum.get_as_string());
                    break;
                case TCKind._tk_struct:
                    DynStruct dynstruct = (DynStruct)factory.create_dyn_any( a );
                    org.omg.DynamicAny.NameValuePair[] members = dynstruct.get_members();
                    System.out.println("[Server]: ** Struct **");
                    for( int i = 0; i < members.length; i++ )
                    {
                        System.out.println("[Server]: name: " + members[i].id + " value: " );
                        printAny( members[i].value);
View Full Code Here

                                            ),
                                            null)
                                                   }
            );

        DynStruct dyn_struct =
            (DynStruct)dynFactory.create_dyn_any_from_type_code(
                    struct_tc );

        // Create a list of name value pairs that holds the struct members.
        // This struct has two members, so we have 2 array elements

        // the first struct member is a string,
        // the member name is "first"

        NameValuePair[]  nvp_seq = new NameValuePair[2];
        Any first_member_any = orb.create_any();
        first_member_any.insert_string("first");
        nvp_seq[0] = new NameValuePair("first", first_member_any );

        /*
         the second member is a recursive sequence, ie. the element
             type of the sequence is that of the enclosing  struct, the
             member name is "second". We'll leave that sequence empty,
             but we have to provide an initialized any for the empty
             sequence, so we create a DynAny that initializes an any
             as an empty sequence
         */

        DynSequence second_member =
            (DynSequence)dynFactory.create_dyn_any_from_type_code(
                    struct_tc.member_type(1) );
        nvp_seq[1] =
            new NameValuePair("second", second_member.to_any() );

        // insert the nvp list into the DynStruct
        dyn_struct.set_members( nvp_seq );

        System.out.println("[Client]: Passing a struct..." +
                s.generic( dyn_struct.to_any() ) );

        // test the primitive get/set operations for DynStruct

        dyn_struct.seek(0);
        dyn_struct.insert_string( "newly inserted" );
        System.out.println("[Client]: Passing the struct again..." +
                s.generic( dyn_struct.to_any() ) );

        dyn_struct.destroy();
        second_member.destroy();

        /*              union            */

        // setting up TypeCodes gets even more complicated,
View Full Code Here

            case TCKind._tk_struct:

                logger_.debug("Any is a struct");

                final DynStruct _dynStruct = DynStructHelper.narrow(any);
                String _currentName;

                _dynStruct.rewind();

                do
                {
                    _currentName = _dynStruct.current_member_name();

                    if (logger_.isDebugEnabled())
                    {
                        logger_.debug(" => " + _currentName);
                    }

                    if (_currentName.equals(_strippedIdentifier))
                    {
                        // expensive operation
                        _cursor = _dynStruct.current_component();
                        break SWITCH_LABEL;
                    }
                } while (_dynStruct.next());

                throw new EvaluationException("struct has no member " + _strippedIdentifier);

            case TCKind._tk_union:
View Full Code Here

    {
        if ("struct".equals (type))
        {
            try
            {
                DynStruct dynStruct = DynStructHelper.narrow
                    (factory.create_dyn_any(value));

                dynStruct.to_any();

            }
            catch (org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode e)
            {
                throw new INTERNAL();
View Full Code Here

TOP

Related Classes of org.omg.DynamicAny.DynStruct

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.