[aspectc-user] Not a member of error when weaving.
Olaf Spinczyk
os at aspectc.org
Mon Jun 27 18:31:18 CEST 2011
Hi!
I removed CLICK_DECLS and CLICK_ENDDECLS as well as the duplicate lines
57 and 58 from your code and used ac++ 1.0 to compile it without any
error message. What is the difference in your setting? Is there anything
magic behind the two macros?
Best regards,
Olaf
On 06/27/2011 06:03 PM, Guilherme . wrote:
> Hi!
>
> The ac++ is reporting following error:
>
> include//click/bighashmap_arena.hh:71: error: `unuse' is not a member
> of `HashMap_Arena'
>
> But as one can clearly see from the header file it is:
>
> 1 // -*- c-basic-offset: 4; related-file-name:
> "../../lib/bighashmap_arena.cc" -*-
> 2 #ifndef CLICK_BIGHASHMAP_ARENA_HH
> 3 #define CLICK_BIGHASHMAP_ARENA_HH
> 4 CLICK_DECLS
> 5
> 6 class HashMap_Arena { public:
> 7
> 8 HashMap_Arena(uint32_t element_size);
> 9
> 10 void use() { _refcount++; }
> 11 void unuse();
> 12
> 13 bool detached() const { return _detached; }
> 14 void detach() { _detached = true; }
> 15
> 16 void *alloc();
> 17 void free(void *);
> 18
> 19 private:
> 20
> 21 struct Link {
> 22 Link *next;
> 23 };
> 24 Link *_free;
> 25
> 26 enum { NELEMENTS = 127 }; // not a power of 2 so we don't fall
> into a
> 27 // too-large bucket
> 28 char *_cur_buffer;
> 29 int _buffer_pos;
> 30
> 31 uint32_t _element_size;
> 32
> 33 char **_buffers;
> 34 int _nbuffers;
> 35 int _buffers_cap;
> 36
> 37 uint32_t _refcount;
> 38 bool _detached;
> 39
> 40 HashMap_Arena(const HashMap_Arena &);
> 41 ~HashMap_Arena();
> 42 HashMap_Arena &operator=(const HashMap_Arena &);
> 43
> 44 void *hard_alloc();
> 45
> 46 friend class Link; // shut up, compiler
> 47
> 48 };
> 49
> 50 class HashMap_ArenaFactory { public:
> 51
> 52 HashMap_ArenaFactory();
> 53 virtual ~HashMap_ArenaFactory();
> 54
> 55 static void static_initialize();
> 56 static void static_cleanup();
> 57
> 58 static HashMap_Arena *get_arena(uint32_t, HashMap_ArenaFactory
> * =0);
> 57
> 58 static HashMap_Arena *get_arena(uint32_t, HashMap_ArenaFactory
> * =0);
> 59 virtual HashMap_Arena *get_arena_func(uint32_t);
> 60
> 61 private:
> 62
> 63 HashMap_Arena **_arenas[2];
> 64 int _narenas[2];
> 65
> 66 static HashMap_ArenaFactory *the_factory;
> 67
> 68 };
> 69
> 70 /*inline*/ void
> 71 HashMap_Arena::unuse()
> 72 {
> 73 _refcount--;
> 74 if (_refcount <= 0)
> 75 delete this;
> 76 }
> 77
> 78 inline void *
> 79 HashMap_Arena::alloc()
> 80 {
> 81 if (_free) {
> 82 void *ret = _free;
> 83 _free = _free->next;
> 84 return ret;
> 85 } else if (_buffer_pos > 0) {
> 86 _buffer_pos -= _element_size;
> 87 return _cur_buffer + _buffer_pos;
> 88 } else
> 89 return hard_alloc();
> 90 }
> 91
> 92 inline void
> 93 HashMap_Arena::free(void *v)
> 94 {
> 95 Link *link = reinterpret_cast<Link *>(v);
> 96 link->next = _free;
> 97 _free = link;
> 98 }
> 99
> 100 CLICK_ENDDECLS
> 101 #endif
>
> The 'inline' keyword was uncommented by me just to make sure that
> wasn't the breaking point.
>
> Anyone got any ideas why this might be breaking?
>
> Thank you,
> Guilherme
>
>
> _______________________________________________
> aspectc-user mailing list
> aspectc-user at aspectc.org
> http://www.aspectc.org/mailman/listinfo/aspectc-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.aspectc.org/pipermail/aspectc-user/attachments/20110627/8e1138a7/attachment.html>
More information about the aspectc-user
mailing list