#include "orbsvcs/Trader/Constraint_Nodes.h"
#include "orbsvcs/Trader/Constraint_Visitors.h"
#include "orbsvcs/Trader/Constraint_Tokens.h"
#include "tao/AnyTypeCode/Any.h"
#include "ace/OS_NS_string.h"
Include dependency graph for Constraint_Nodes.cpp:
Go to the source code of this file.
TAO_Literal_Constraint operator * | ( | const TAO_Literal_Constraint & | left, | |
const TAO_Literal_Constraint & | right | |||
) |
Definition at line 843 of file Constraint_Nodes.cpp.
References TAO_DOUBLE, TAO_SIGNED, TAO_UNSIGNED, and TAO_Literal_Constraint::widest_type().
00845 { 00846 TAO_Expression_Type widest_type = 00847 TAO_Literal_Constraint::widest_type (left, right); 00848 00849 switch (widest_type) 00850 { 00851 case TAO_DOUBLE: 00852 { 00853 CORBA::Double result = (CORBA::Double) left * (CORBA::Double) right; 00854 return TAO_Literal_Constraint (result); 00855 } 00856 case TAO_SIGNED: 00857 { 00858 CORBA::LongLong result = static_cast<CORBA::LongLong> (left) * 00859 static_cast<CORBA::LongLong> (right); 00860 return TAO_Literal_Constraint (result); 00861 } 00862 case TAO_UNSIGNED: 00863 { 00864 CORBA::ULongLong result = static_cast<CORBA::ULongLong> (left) * 00865 static_cast<CORBA::ULongLong> (right); 00866 return TAO_Literal_Constraint (result); 00867 } 00868 default: 00869 return TAO_Literal_Constraint (static_cast<CORBA::LongLong> (0)); 00870 } 00871 }
bool operator!= | ( | const TAO_Literal_Constraint & | left, | |
const TAO_Literal_Constraint & | right | |||
) |
Definition at line 610 of file Constraint_Nodes.cpp.
References ACE_OS::strcmp(), TAO_BOOLEAN, TAO_DOUBLE, TAO_SIGNED, TAO_STRING, TAO_UNSIGNED, and TAO_Literal_Constraint::widest_type().
00612 { 00613 bool return_value = false; 00614 TAO_Expression_Type widest_type = 00615 TAO_Literal_Constraint::widest_type (left, right); 00616 00617 switch (widest_type) 00618 { 00619 case TAO_STRING: 00620 return_value = (ACE_OS::strcmp ((const char*) left, (const char*) right) != 0); 00621 break; 00622 case TAO_DOUBLE: 00623 return_value = (CORBA::Double) left != (CORBA::Double) right; 00624 break; 00625 case TAO_SIGNED: 00626 return_value = static_cast<CORBA::LongLong> (left) != 00627 static_cast<CORBA::LongLong> (right); 00628 break; 00629 case TAO_UNSIGNED: 00630 return_value = static_cast<CORBA::ULongLong> (left) != 00631 static_cast<CORBA::ULongLong> (right); 00632 break; 00633 case TAO_BOOLEAN: 00634 return_value = (CORBA::Boolean) left != (CORBA::Boolean) right; 00635 break; 00636 } 00637 00638 return return_value; 00639 }
TAO_Literal_Constraint operator+ | ( | const TAO_Literal_Constraint & | left, | |
const TAO_Literal_Constraint & | right | |||
) |
Definition at line 781 of file Constraint_Nodes.cpp.
References TAO_DOUBLE, TAO_SIGNED, TAO_UNSIGNED, and TAO_Literal_Constraint::widest_type().
00783 { 00784 TAO_Expression_Type widest_type = 00785 TAO_Literal_Constraint::widest_type (left, right); 00786 00787 switch (widest_type) 00788 { 00789 case TAO_DOUBLE: 00790 { 00791 CORBA::Double result = (CORBA::Double) left + (CORBA::Double) right; 00792 return TAO_Literal_Constraint (result); 00793 } 00794 case TAO_SIGNED: 00795 { 00796 CORBA::LongLong result = static_cast<CORBA::LongLong> (left) + 00797 static_cast<CORBA::LongLong> (right); 00798 return TAO_Literal_Constraint (result); 00799 } 00800 case TAO_UNSIGNED: 00801 { 00802 CORBA::ULongLong result = static_cast<CORBA::ULongLong> (left) + 00803 static_cast<CORBA::ULongLong> (right); 00804 return TAO_Literal_Constraint (result); 00805 } 00806 default: 00807 return TAO_Literal_Constraint (static_cast<CORBA::LongLong> (0)); 00808 } 00809 }
TAO_Literal_Constraint operator- | ( | const TAO_Literal_Constraint & | operand | ) |
Definition at line 905 of file Constraint_Nodes.cpp.
References TAO_Literal_Constraint::expr_type(), TAO_DOUBLE, TAO_SIGNED, and TAO_UNSIGNED.
00906 { 00907 switch (operand.expr_type ()) 00908 { 00909 case TAO_DOUBLE: 00910 { 00911 CORBA::Double result = - (CORBA::Double) operand; 00912 return TAO_Literal_Constraint (result); 00913 } 00914 case TAO_SIGNED: 00915 { 00916 CORBA::LongLong result = - static_cast<CORBA::LongLong> (operand); 00917 return TAO_Literal_Constraint (result); 00918 } 00919 case TAO_UNSIGNED: 00920 { 00921 CORBA::LongLong result = - static_cast<CORBA::LongLong> ( 00922 static_cast<CORBA::ULongLong> (operand)); 00923 return TAO_Literal_Constraint (static_cast<CORBA::ULongLong> (result)); 00924 } 00925 default: 00926 return TAO_Literal_Constraint (static_cast<CORBA::LongLong> (0)); 00927 } 00928 }
TAO_Literal_Constraint operator- | ( | const TAO_Literal_Constraint & | left, | |
const TAO_Literal_Constraint & | right | |||
) |
Definition at line 812 of file Constraint_Nodes.cpp.
References TAO_DOUBLE, TAO_SIGNED, TAO_UNSIGNED, and TAO_Literal_Constraint::widest_type().
00814 { 00815 TAO_Expression_Type widest_type = 00816 TAO_Literal_Constraint::widest_type (left, right); 00817 00818 switch (widest_type) 00819 { 00820 case TAO_DOUBLE: 00821 { 00822 CORBA::Double result = (CORBA::Double) left - (CORBA::Double) right; 00823 return TAO_Literal_Constraint (result); 00824 } 00825 case TAO_SIGNED: 00826 { 00827 CORBA::LongLong result = static_cast<CORBA::LongLong> (left) - 00828 static_cast<CORBA::LongLong> (right); 00829 return TAO_Literal_Constraint (result); 00830 } 00831 case TAO_UNSIGNED: 00832 { 00833 CORBA::ULongLong result = static_cast<CORBA::ULongLong> (left) - 00834 static_cast<CORBA::ULongLong> (right); 00835 return TAO_Literal_Constraint (result); 00836 } 00837 default: 00838 return TAO_Literal_Constraint (static_cast<CORBA::LongLong> (0)); 00839 } 00840 }
TAO_Literal_Constraint operator/ | ( | const TAO_Literal_Constraint & | left, | |
const TAO_Literal_Constraint & | right | |||
) |
Definition at line 874 of file Constraint_Nodes.cpp.
References TAO_DOUBLE, TAO_SIGNED, TAO_UNSIGNED, and TAO_Literal_Constraint::widest_type().
00876 { 00877 TAO_Expression_Type widest_type = 00878 TAO_Literal_Constraint::widest_type (left, right); 00879 00880 switch (widest_type) 00881 { 00882 case TAO_DOUBLE: 00883 { 00884 CORBA::Double result = (CORBA::Double) left / (CORBA::Double) right; 00885 return TAO_Literal_Constraint (result); 00886 } 00887 case TAO_SIGNED: 00888 { 00889 CORBA::LongLong result = static_cast<CORBA::LongLong> (left) / 00890 static_cast<CORBA::LongLong> (right); 00891 return TAO_Literal_Constraint (result); 00892 } 00893 case TAO_UNSIGNED: 00894 { 00895 CORBA::ULongLong result = static_cast<CORBA::ULongLong> (left) / 00896 static_cast<CORBA::ULongLong> (right); 00897 return TAO_Literal_Constraint (result); 00898 } 00899 default: 00900 return TAO_Literal_Constraint (static_cast<CORBA::LongLong> (0)); 00901 } 00902 }
bool operator< | ( | const TAO_Literal_Constraint & | left, | |
const TAO_Literal_Constraint & | right | |||
) |
Definition at line 642 of file Constraint_Nodes.cpp.
References ACE_OS::strcmp(), TAO_BOOLEAN, TAO_DOUBLE, TAO_SIGNED, TAO_STRING, TAO_UNSIGNED, and TAO_Literal_Constraint::widest_type().
00644 { 00645 bool return_value = false; 00646 TAO_Expression_Type widest_type = 00647 TAO_Literal_Constraint::widest_type (left, right); 00648 00649 switch (widest_type) 00650 { 00651 case TAO_STRING: 00652 return_value = (ACE_OS::strcmp ((const char*) left, (const char*) right) < 0); 00653 break; 00654 case TAO_DOUBLE: 00655 return_value = (CORBA::Double) left < (CORBA::Double) right; 00656 break; 00657 case TAO_SIGNED: 00658 return_value = static_cast<CORBA::LongLong> (left) < 00659 static_cast<CORBA::LongLong> (right); 00660 break; 00661 case TAO_UNSIGNED: 00662 return_value = static_cast<CORBA::ULongLong> (left) < 00663 static_cast<CORBA::ULongLong> (right); 00664 break; 00665 case TAO_BOOLEAN: 00666 return_value = (CORBA::Boolean) left < (CORBA::Boolean) right; 00667 break; 00668 } 00669 00670 return return_value; 00671 }
bool operator<= | ( | const TAO_Literal_Constraint & | left, | |
const TAO_Literal_Constraint & | right | |||
) |
Definition at line 674 of file Constraint_Nodes.cpp.
References ACE_OS::strcmp(), TAO_DOUBLE, TAO_SIGNED, TAO_STRING, TAO_UNSIGNED, and TAO_Literal_Constraint::widest_type().
00676 { 00677 bool return_value = false; 00678 TAO_Expression_Type widest_type = 00679 TAO_Literal_Constraint::widest_type (left, right); 00680 00681 switch (widest_type) 00682 { 00683 case TAO_STRING: 00684 return_value = (ACE_OS::strcmp ((const char*) left, (const char*) right) <= 0); 00685 break; 00686 case TAO_DOUBLE: 00687 return_value = (CORBA::Double) left <= (CORBA::Double) right; 00688 break; 00689 case TAO_SIGNED: 00690 return_value = static_cast<CORBA::LongLong> (left) <= 00691 static_cast<CORBA::LongLong> (right); 00692 break; 00693 case TAO_UNSIGNED: 00694 return_value = static_cast<CORBA::ULongLong> (left) <= 00695 static_cast<CORBA::ULongLong> (right); 00696 break; 00697 } 00698 00699 return return_value; 00700 }
bool operator== | ( | const TAO::String_Manager & | left, | |
const TAO_Literal_Constraint & | right | |||
) |
Definition at line 768 of file Constraint_Nodes.cpp.
References ACE_OS::strcmp().
00770 { 00771 bool result = false; 00772 00773 if ((const char*) right != 0) 00774 result = ACE_OS::strcmp ((const char*) left, 00775 (const char*) right) == 0; 00776 return result; 00777 }
bool operator== | ( | CORBA::Double | left, | |
const TAO_Literal_Constraint & | right | |||
) |
Definition at line 762 of file Constraint_Nodes.cpp.
00763 { 00764 return (left == (CORBA::Double) right); 00765 }
bool operator== | ( | const TAO_Literal_Constraint & | left, | |
const TAO_Literal_Constraint & | right | |||
) |
Definition at line 577 of file Constraint_Nodes.cpp.
References ACE_OS::strcmp(), TAO_BOOLEAN, TAO_DOUBLE, TAO_SIGNED, TAO_STRING, TAO_UNSIGNED, and TAO_Literal_Constraint::widest_type().
00579 { 00580 bool return_value = false; 00581 TAO_Expression_Type widest_type = 00582 TAO_Literal_Constraint::widest_type (left, right); 00583 00584 switch (widest_type) 00585 { 00586 case TAO_STRING: 00587 return_value = (ACE_OS::strcmp ((const char*) left, (const char*) right) == 0); 00588 break; 00589 case TAO_DOUBLE: 00590 return_value = (CORBA::Double) left == (CORBA::Double) right; 00591 break; 00592 case TAO_SIGNED: 00593 return_value = static_cast<CORBA::LongLong> (left) == 00594 static_cast<CORBA::LongLong> (right); 00595 break; 00596 case TAO_UNSIGNED: 00597 return_value = static_cast<CORBA::ULongLong> (left) == 00598 static_cast<CORBA::ULongLong> (right); 00599 break; 00600 case TAO_BOOLEAN: 00601 return_value = (CORBA::Boolean) left == (CORBA::Boolean) right; 00602 break; 00603 } 00604 00605 return return_value; 00606 }
bool operator> | ( | const TAO_Literal_Constraint & | left, | |
const TAO_Literal_Constraint & | right | |||
) |
Definition at line 703 of file Constraint_Nodes.cpp.
References ACE_OS::strcmp(), TAO_DOUBLE, TAO_SIGNED, TAO_STRING, TAO_UNSIGNED, and TAO_Literal_Constraint::widest_type().
00705 { 00706 bool return_value = false; 00707 TAO_Expression_Type widest_type = 00708 TAO_Literal_Constraint::widest_type (left, right); 00709 00710 switch (widest_type) 00711 { 00712 case TAO_STRING: 00713 return_value = (ACE_OS::strcmp ((const char*) left, (const char*) right) > 0); 00714 break; 00715 case TAO_DOUBLE: 00716 return_value = (CORBA::Double) left > (CORBA::Double) right; 00717 break; 00718 case TAO_SIGNED: 00719 return_value = static_cast<CORBA::LongLong> (left) > 00720 static_cast<CORBA::LongLong> (right); 00721 break; 00722 case TAO_UNSIGNED: 00723 return_value = static_cast<CORBA::ULongLong> (left) > 00724 static_cast<CORBA::ULongLong> (right); 00725 break; 00726 } 00727 00728 return return_value; 00729 }
bool operator>= | ( | const TAO_Literal_Constraint & | left, | |
const TAO_Literal_Constraint & | right | |||
) |
Definition at line 732 of file Constraint_Nodes.cpp.
References ACE_OS::strcmp(), TAO_DOUBLE, TAO_SIGNED, TAO_STRING, TAO_UNSIGNED, and TAO_Literal_Constraint::widest_type().
00734 { 00735 bool return_value = false; 00736 TAO_Expression_Type widest_type = 00737 TAO_Literal_Constraint::widest_type (left, right); 00738 00739 switch (widest_type) 00740 { 00741 case TAO_STRING: 00742 return_value = (ACE_OS::strcmp ((const char*) left, (const char*) right) >= 0); 00743 break; 00744 case TAO_DOUBLE: 00745 return_value = (CORBA::Double) left >= (CORBA::Double) right; 00746 break; 00747 case TAO_SIGNED: 00748 return_value = static_cast<CORBA::LongLong> (left) >= 00749 static_cast<CORBA::LongLong> (right); 00750 break; 00751 case TAO_UNSIGNED: 00752 return_value = static_cast<CORBA::ULongLong> (left) >= 00753 static_cast<CORBA::ULongLong> (right); 00754 break; 00755 } 00756 00757 return return_value; 00758 }
int(*[]) dispatch_table(TAO_Constraint_Visitor *, TAO_Binary_Constraint *) [static] |
Initial value:
{ TAO_Binary_Constraint::visit_greater_than, TAO_Binary_Constraint::visit_greater_than_equal, TAO_Binary_Constraint::visit_less_than, TAO_Binary_Constraint::visit_less_than_equal, TAO_Binary_Constraint::visit_equal, TAO_Binary_Constraint::visit_not_equal, 0, TAO_Binary_Constraint::visit_and, TAO_Binary_Constraint::visit_or, 0, TAO_Binary_Constraint::visit_in, TAO_Binary_Constraint::visit_twiddle, 0, TAO_Binary_Constraint::visit_add, TAO_Binary_Constraint::visit_sub, TAO_Binary_Constraint::visit_mult, TAO_Binary_Constraint::visit_div }
Definition at line 49 of file Constraint_Nodes.cpp.
Referenced by TAO_Binary_Constraint::accept().