Exemplo n.º 1
0
 /// <summary>
 /// Constructor
 /// </summary>
 public HlaObjectClass() : base()
 {
     Attributes        = new List <HlaAttribute>();
     PrivilegeToDelete = new HlaAttribute("HLAprivilegeToDeleteObject", PSKind.Neither);// !!! Naming only conforms to HLA1516-2010
     //PrivilegeToDelete = new HlaAttribute("privilegeToDelete", PSKind.Neither);// !!! Naming only conforms to HLA13
     Attributes.Add(PrivilegeToDelete);
 }
Exemplo n.º 2
0
 /// <summary>
 /// Is value updated?
 /// </summary>
 /// <param name="attribute">attribute</param>
 public bool IsValueUpdated(HlaAttribute attribute)
 {
     foreach (var item in ObjectInstance.Attributes)
     {
         if (item.Handle == attribute.Handle)
         {
             return(true);
         }
     }
     return(false);
 }
Exemplo n.º 3
0
 /// <summary>
 /// Adds an object class to object model.
 /// </summary>
 /// <exception cref="ArgumentException">An element with the same key already exists in the Attribute Region Pairs.</exception>
 ///
 public void Add(HlaAttribute attribute, HlaRegion region)
 {
     try
     {
         Pairs.Add(attribute, region);
     }
     catch (ArgumentException e)
     {
         string msg = "EXC-(Add - AttributeRegionPairs): An element with the same key already exists in the Attribute Region Pairs. " + e.ToString();
         // !!! add this to Racon logger
     }
 }
Exemplo n.º 4
0
        /// <summary>
        /// Gets attribute value specified by attribute reference. This function simplifies decoding value of an attribute, so that the user does not need to iterate all attributes of an object instance.
        /// </summary>
        /// <param name="attribute">attribute</param>
        public T GetAttributeValue <T>(HlaAttribute attribute)
        {
            T result = default(T);

            foreach (var item in ObjectInstance.Attributes)
            {
                if (item.Handle == attribute.Handle)
                {
                    result = item.GetValue <T>();
                    break;
                }
            }
            return(result);
        }
Exemplo n.º 5
0
 /// <summary>
 /// AddAttribute
 /// </summary>
 /// <param name="_attr"></param>
 public void AddAttribute(HlaAttribute _attr)
 {
     Attributes.Add(_attr.Handle);
 }
Exemplo n.º 6
0
 /// <summary>
 /// AddAttributeValue
 /// </summary>
 /// <typeparam name="_type"></typeparam>
 /// <param name="attribute"></param>
 /// <param name="value"></param>
 public void AddAttributeValue <_type>(HlaAttribute attribute, _type value) where _type : struct
 {
     attribute.AddValue(value);
     Attributes.Add(attribute);
 }
Exemplo n.º 7
0
 /// <summary>
 /// AddAttributeValue
 /// </summary>
 /// <param name="attribute"></param>
 /// <param name="value"></param>
 public void AddAttributeValue(HlaAttribute attribute, DateTime value)
 {
     attribute.AddValue(value);
     Attributes.Add(attribute);
 }
Exemplo n.º 8
0
 /// <summary>
 /// AddAttributeValue
 /// </summary>
 /// <param name="attribute"></param>
 /// <param name="value"></param>
 public void AddAttributeValue(HlaAttribute attribute, string value)
 {
     attribute.AddValue(value);
     Attributes.Add(attribute);
 }
Exemplo n.º 9
0
 /// <summary>
 /// Add attribute
 /// </summary>
 /// <param name="attribute"></param>
 public void AddAttribute(HlaAttribute attribute)
 {
     Attributes.Add(attribute);
 }