Exemple #1
0
 private void SetTypeCode(TypeCode typeCode)
 {
     if (!(typeCode is omg.org.CORBA.TypeCodeImpl))
     {
         throw new INTERNAL(567, CompletionStatus.Completed_MayBe);
     }
     m_typeCode = (TypeCodeImpl)typeCode;
 }
        /// <summary>
        /// used for recursive type code creation
        /// </summary>
        private void RegisterCreatedTypeCodeForType(Type forType,
                                                    AttributeExtCollection attributes,
                                                    TypeCodeImpl typeCode)
        {
            TypecodeForTypeKey key = new TypecodeForTypeKey(forType, attributes);

            lock (m_alreadyCreatedTypeCodes)
                m_alreadyCreatedTypeCodes[key] = typeCode;
        }
        public void TestSequenceTC()
        {
            TypeCodeImpl seqMemberType = (TypeCodeImpl)m_orb.create_octet_tc();

            omg.org.CORBA.TypeCode seqOfOctet_TC =
                m_orb.create_sequence_tc(0, seqMemberType);
            Assert.AreEqual(TCKind.tk_sequence, seqOfOctet_TC.kind(), "sequence kind");
            Assert.AreEqual(seqMemberType.GetClsForTypeCode(),
                            ((TypeCodeImpl)seqOfOctet_TC.content_type()).GetClsForTypeCode(), "sequence member type");
        }
Exemple #4
0
 /// <summary>
 /// create the type with name fullname, described by forTypeCode!
 /// </summary>
 /// <param name="fullname"></param>
 /// <param name="forTypeCode"></param>
 /// <returns></returns>
 internal Type CreateOrGetType(string fullname, TypeCodeImpl forTypeCode)
 {
     lock (this) {
         Type result = RetrieveType(fullname);
         if (result == null)
         {
             result = forTypeCode.CreateType(m_modBuilder, fullname);
             Repository.RegisterDynamicallyCreatedType(result);
         }
         return(result);
     }
 }
        public void TestAliasTC()
        {
            string       name       = "OrbServices_TestAlias";
            string       aliasRepId = "IDL:Ch/Elca/Iiop/Tests/" + name + ":1.0";
            TypeCodeImpl aliasedTC  = (TypeCodeImpl)m_orb.create_long_tc();

            omg.org.CORBA.TypeCode alias_TC =
                m_orb.create_alias_tc(aliasRepId, name, aliasedTC);
            Assert.AreEqual(aliasRepId, alias_TC.id(), "alias id");
            Assert.AreEqual(TCKind.tk_alias, alias_TC.kind(), "alias kind");
            Assert.AreEqual(aliasedTC.GetClsForTypeCode(),
                            ((TypeCodeImpl)alias_TC).GetClsForTypeCode(), "alias cls type");
        }