Revise typesafe MSA implementation to hopefully compile under Sun's
authorPhil Miller <mille121@illinois.edu>
Thu, 23 Oct 2008 18:14:08 +0000 (18:14 +0000)
committerPhil Miller <mille121@illinois.edu>
Thu, 23 Oct 2008 18:14:08 +0000 (18:14 +0000)
even more broken C++ compiler.

Task: Typesafe MSA
Hours: 1
Summary: make the revised version (hopefully) build on net-sol-cc

src/libs/ck-libs/ParFUM/MsaHashtable.h
src/libs/ck-libs/multiphaseSharedArrays/msa-distArray.h

index 508e11f155d0116e622d9ec01d09fd62aa39b82c..3a79680c1661aa7d5946c943a207b402cc87e304 100644 (file)
@@ -21,8 +21,15 @@ public:
        {
        public:
                using MSA1DHASH::Read::get;
+               // Non-specific friend declarations because Sun's
+               // C++ compiler doesn't understand that it should
+               // fully parse outer classes before examining nested
+               // classes. (2008-10-23)
+               /*
                friend Read &MsaHashtable::syncToRead(Add&);
                friend Add& MsaHashtable::syncToAdd(Read&);
+               */
+               friend class MsaHashtable;
                void print();
 
        private:
@@ -32,13 +39,16 @@ public:
        class Add : private MSA1DHASH::Accum
        {
                using MSA1DHASH::Accum::accumulate;
+               // See comments above about non-specific friends
+               /*
                friend Add& MsaHashtable::syncToAdd(Read&);
                friend Read &MsaHashtable::syncToRead(Add&);
                friend Add& MsaHashtable::getInitialAdd();
+               */
+               friend class MsaHashtable;
        Add(MsaHashtable &m) : MSA1DHASH::Accum(m) { }
        public:
                int addTuple(int *tuple, int nodesPerTuple, int chunk, int elementNo);
-
        };
 
 
index 8e6b8bd7ab7000816d8224dee598fab1efa27c34..2e1a1bd60c9ab9069f757aaa1d55ade863fe293d 100644 (file)
@@ -35,6 +35,11 @@ public:
     typedef CProxy_MSA_CacheGroup<ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE> CProxy_CacheGroup_t;
     typedef CProxy_MSA_PageArray<ENTRY, ENTRY_OPS_CLASS, ENTRIES_PER_PAGE> CProxy_PageArray_t;
 
+    // Sun's C++ compiler doesn't understand that nested classes are
+    // members for the sake of access to private data. (2008-10-23)
+    class Read; class Write; class Accum;
+    friend class Read; friend class Write; friend class Accum;
+
        class Handle
        {
     public: