GIOP_Message_Generator_Parser_Impl.inl

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 //GIOP_Message_Generator_Parser_Impl.inl,v 1.8 2005/11/30 17:48:42 isisbuilds Exp
00004 
00005 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00006 
00007 ACE_INLINE CORBA::Boolean
00008 TAO_GIOP_Message_Generator_Parser_Impl::check_revision (
00009   CORBA::Octet incoming_major,
00010   CORBA::Octet incoming_minor)
00011 {
00012   CORBA::UShort const version_as_whole_num =
00013     incoming_major << 8 | incoming_minor;
00014 
00015   CORBA::UShort const max_allowable_version =
00016     TAO_DEF_GIOP_MAJOR << 8 | TAO_DEF_GIOP_MINOR;
00017 
00018   // If it's greater than the max, we know it's not allowed.
00019   if (version_as_whole_num > max_allowable_version)
00020     return 0;
00021 
00022   // If it's less than the max, though, we still have to check for
00023   // each explicit version and only allow the ones we know work.
00024   switch (version_as_whole_num)
00025     {
00026     case 0x0100:
00027     case 0x0101:
00028     case 0x0102:
00029       return 1;
00030     }
00031 
00032   return 0;
00033 }
00034 
00035 TAO_END_VERSIONED_NAMESPACE_DECL

Generated on Thu Nov 9 11:54:12 2006 for TAO by doxygen 1.3.6